Skip to content

Commit

Permalink
small workaround for font in nme
Browse files Browse the repository at this point in the history
  • Loading branch information
yanhick committed May 18, 2013
1 parent 2ca7501 commit aa68cdc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cocktail/port/platform/flash_player/FontBuilder.hx
Expand Up @@ -83,7 +83,12 @@ class FontBuilder extends FontBuilderBase

textField.text = " ";
textField.setTextFormat(textFormat);
#if flash
fontMetricsVO.spaceWidth = textField.textWidth;
//for nme textWidth don't seem to work when only space
#else
fontMetricsVO.spaceWidth = textField.width;
#end

return fontMetricsVO;
}
Expand Down Expand Up @@ -174,11 +179,11 @@ class FontBuilder extends FontBuilderBase

textField.text = "x";
textField.setTextFormat(textFormat);
fontMetrics.ascent = textField.textHeight / 2;
fontMetrics.ascent = textField.height / 2;

textField.text = ",";
textField.setTextFormat(textFormat);
fontMetrics.descent = textField.textHeight / 2;
fontMetrics.descent = textField.height / 2;
#end
}

Expand Down

0 comments on commit aa68cdc

Please sign in to comment.