This commit is contained in:
Vadim Lopatin 2014-04-02 13:33:34 +04:00
parent fbe9ef75fb
commit 912961b48e
2 changed files with 6 additions and 6 deletions

View File

@ -254,6 +254,7 @@ private class FreeTypeFontFile {
glyph.originX = cast(byte)(_slot.metrics.horiBearingX >> 6);
glyph.originY = cast(byte)(_slot.metrics.horiBearingY >> 6);
glyph.width = cast(ubyte)(myabs(cast(int)(_slot.metrics.horiAdvance)) >> 6);
glyph.glyphIndex = cast(ushort)code;
if (withImage) {
FT_Bitmap* bitmap = &_slot.bitmap;
ubyte w = cast(ubyte)(bitmap.width);

View File

@ -34,13 +34,12 @@ class TextWidget : Widget {
override void measure(int parentWidth, int parentHeight) {
FontRef font = font();
auto measureStart = std.datetime.Clock.currAppTick;
//auto measureStart = std.datetime.Clock.currAppTick;
Point sz = font.textSize(text);
auto measureEnd = std.datetime.Clock.currAppTick;
auto duration = measureEnd - measureStart;
//if (duration > 10000)
if (duration.length > 10)
Log.d("TextWidget measureText took ", duration.length, " ticks");
//auto measureEnd = std.datetime.Clock.currAppTick;
//auto duration = measureEnd - measureStart;
//if (duration.length > 10)
// Log.d("TextWidget measureText took ", duration.length, " ticks");
measuredContent(parentWidth, parentHeight, sz.x, sz.y);
}