mirror of https://github.com/buggins/dlangui.git
freetype fonts support enhancement, fix #464
This commit is contained in:
parent
e60be3ec1b
commit
7ba34614bd
|
@ -356,7 +356,7 @@ struct Glyph
|
|||
/// 0: width of glyph black box
|
||||
ushort blackBoxX;
|
||||
|
||||
@property ushort correctedBlackBoxX() { return subpixelMode ? blackBoxX / 3 : blackBoxX; }
|
||||
@property ushort correctedBlackBoxX() { return subpixelMode ? (blackBoxX + 2) / 3 : blackBoxX; }
|
||||
|
||||
|
||||
/// 2: height of glyph black box
|
||||
|
|
|
@ -226,7 +226,7 @@ class Font : RefCountedObject {
|
|||
uint len = cast(uint)text.length;
|
||||
if (widths.length < len)
|
||||
widths.length = len + 1;
|
||||
bool useKerning = allowKerning;
|
||||
bool useKerning = allowKerning && family != FontFamily.MonoSpace;
|
||||
int x = 0;
|
||||
int charsMeasured = 0;
|
||||
int * pwidths = widths.ptr;
|
||||
|
|
|
@ -261,6 +261,8 @@ class FreeTypeFontFile {
|
|||
ubyte h = cast(ubyte)(bitmap.rows);
|
||||
glyph.blackBoxX = w;
|
||||
glyph.blackBoxY = h;
|
||||
glyph.originX = cast(byte)(_slot.bitmap_left);
|
||||
glyph.originY = cast(byte)(_slot.bitmap_top);
|
||||
int sz = w * cast(int)h;
|
||||
if (sz > 0) {
|
||||
glyph.glyph = new ubyte[sz];
|
||||
|
|
|
@ -1 +1 @@
|
|||
v0.9.152
|
||||
v0.9.153
|
Loading…
Reference in New Issue