upgrade bindbc-freetype dependency

This commit is contained in:
Vadim Lopatin 2024-03-04 10:48:08 +00:00
parent 2f0ae834eb
commit 774f216ea7
2 changed files with 13 additions and 13 deletions

View File

@ -59,7 +59,7 @@
"libs-windows": ["opengl32"], "libs-windows": ["opengl32"],
"dependencies": { "dependencies": {
"bindbc-opengl": "~>1.1.0", "bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1", "bindbc-freetype": "~>1.2.2",
"bindbc-sdl": "~>1.4.5" "bindbc-sdl": "~>1.4.5"
}, },
"copyFiles-windows-x86_64": [ "copyFiles-windows-x86_64": [
@ -81,7 +81,7 @@
"libs-windows": ["opengl32"], "libs-windows": ["opengl32"],
"dependencies": { "dependencies": {
"bindbc-opengl": "~>1.1.0", "bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1" "bindbc-freetype": "~>1.2.2"
} }
}, },
{ {
@ -92,7 +92,7 @@
"libs-windows": ["opengl32"], "libs-windows": ["opengl32"],
"dependencies": { "dependencies": {
"bindbc-opengl": "~>1.1.0", "bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1", "bindbc-freetype": "~>1.2.2",
"bindbc-sdl": "~>1.4.5", "bindbc-sdl": "~>1.4.5",
"icontheme": "~>1.2.3" "icontheme": "~>1.2.3"
} }
@ -103,7 +103,7 @@
"versions-windows": ["Unicode"], "versions-windows": ["Unicode"],
"dependencies": { "dependencies": {
"bindbc-opengl": "~>1.1.0", "bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1", "bindbc-freetype": "~>1.2.2",
"bindbc-sdl": "~>1.4.5", "bindbc-sdl": "~>1.4.5",
"icontheme": "~>1.2.3" "icontheme": "~>1.2.3"
}, },
@ -123,7 +123,7 @@
"libs-posix": ["GLX"], "libs-posix": ["GLX"],
"dependencies": { "dependencies": {
"bindbc-opengl": "~>1.1.0", "bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1", "bindbc-freetype": "~>1.2.2",
"x11": "~>1.0.21", "x11": "~>1.0.21",
"icontheme": "~>1.2.3", "icontheme": "~>1.2.3",
"glx-d": "~>1.1.0" "glx-d": "~>1.1.0"
@ -135,7 +135,7 @@
"versions-windows": ["Unicode"], "versions-windows": ["Unicode"],
"dependencies": { "dependencies": {
"bindbc-opengl": "~>1.1.0", "bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1", "bindbc-freetype": "~>1.2.2",
"dsfml": "~>2.1.0", "dsfml": "~>2.1.0",
"icontheme": "~>1.2.3" "icontheme": "~>1.2.3"
}, },

View File

@ -201,10 +201,10 @@ class FreeTypeFontFile {
/// find glyph index for character /// find glyph index for character
FT_UInt getCharIndex(dchar code, dchar def_char = 0) { uint getCharIndex(dchar code, dchar def_char = 0) {
if ( code=='\t' ) if ( code=='\t' )
code = ' '; code = ' ';
FT_UInt ch_glyph_index = FT_Get_Char_Index(_face, code); uint ch_glyph_index = FT_Get_Char_Index(_face, code);
if (ch_glyph_index == 0) { if (ch_glyph_index == 0) {
dchar replacement = getReplacementChar(code); dchar replacement = getReplacementChar(code);
if (replacement) { if (replacement) {
@ -313,7 +313,7 @@ class FreeTypeFontFile {
_face = null; _face = null;
} }
int getKerningOffset(FT_UInt prevCharIndex, FT_UInt nextCharIndex) { int getKerningOffset(uint prevCharIndex, uint nextCharIndex) {
const FT_KERNING_DEFAULT = 0; const FT_KERNING_DEFAULT = 0;
FT_Vector delta; FT_Vector delta;
int error = FT_Get_Kerning( _face, /* handle to face object */ int error = FT_Get_Kerning( _face, /* handle to face object */
@ -372,7 +372,7 @@ class FreeTypeFont : Font {
} }
/// find glyph index for character /// find glyph index for character
bool findGlyph(dchar code, dchar def_char, ref FT_UInt index, ref FreeTypeFontFile file) { bool findGlyph(dchar code, dchar def_char, ref uint index, ref FreeTypeFontFile file) {
foreach(FreeTypeFontFile f; _files) { foreach(FreeTypeFontFile f; _files) {
index = f.getCharIndex(code, def_char); index = f.getCharIndex(code, def_char);
if (index != 0) { if (index != 0) {
@ -392,11 +392,11 @@ class FreeTypeFont : Font {
override int getKerningOffset(dchar prevChar, dchar currentChar) { override int getKerningOffset(dchar prevChar, dchar currentChar) {
if (!_allowKerning || !prevChar || !currentChar) if (!_allowKerning || !prevChar || !currentChar)
return 0; return 0;
FT_UInt index1; uint index1;
FreeTypeFontFile file1; FreeTypeFontFile file1;
if (!findGlyph(prevChar, 0, index1, file1)) if (!findGlyph(prevChar, 0, index1, file1))
return 0; return 0;
FT_UInt index2; uint index2;
FreeTypeFontFile file2; FreeTypeFontFile file2;
if (!findGlyph(currentChar, 0, index2, file2)) if (!findGlyph(currentChar, 0, index2, file2))
return 0; return 0;
@ -418,7 +418,7 @@ class FreeTypeFont : Font {
if (found !is null) if (found !is null)
return found; return found;
//Log.v("Glyph ", ch, " is not found in cache, getting from font"); //Log.v("Glyph ", ch, " is not found in cache, getting from font");
FT_UInt index; uint index;
FreeTypeFontFile file; FreeTypeFontFile file;
if (!findGlyph(ch, 0, index, file)) { if (!findGlyph(ch, 0, index, file)) {
if (!findGlyph(ch, '?', index, file)) if (!findGlyph(ch, '?', index, file))