Skip to content

Commit

Permalink
Passed font-variation with font-family
Browse files Browse the repository at this point in the history
We have added font-variation with font-family.
  • Loading branch information
ramghaju committed Sep 24, 2015
1 parent 54037be commit 0e7025c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/modules/monotype.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,20 @@ goog.scope(function() {
function checkAndLoadIfDownloaded() {
if (loadWindow[Monotype.HOOK + projectId]) {
var mti_fnts = loadWindow[Monotype.HOOK + projectId](),
fonts = [];
fonts = [],
fntVariation;

if (mti_fnts) {
for (var i = 0; i < mti_fnts.length; i++) {
fonts.push(new Font(mti_fnts[i]["fontfamily"]));
var fnt=mti_fnts[i]["fontfamily"];

//Check if font-style and font-weight is available
if(mti_fnts[i]["fontStyle"]!=undefined && mti_fnts[i]["fontWeight"]!=undefined) {
fntVariation=mti_fnts[i]["fontStyle"]+mti_fnts[i]["fontWeight"];
fonts.push(new Font(fnt,fntVariation));
} else {
fonts.push(new Font(fnt));
}
}
}
onReady(fonts);
Expand Down

0 comments on commit 0e7025c

Please sign in to comment.