Skip to content

Commit

Permalink
upgrade bindbc-freetype dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
buggins committed Mar 4, 2024
1 parent 2f0ae83 commit 774f216
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"libs-windows": ["opengl32"],
"dependencies": {
"bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1",
"bindbc-freetype": "~>1.2.2",
"bindbc-sdl": "~>1.4.5"
},
"copyFiles-windows-x86_64": [
Expand All @@ -81,7 +81,7 @@
"libs-windows": ["opengl32"],
"dependencies": {
"bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1"
"bindbc-freetype": "~>1.2.2"
}
},
{
Expand All @@ -92,7 +92,7 @@
"libs-windows": ["opengl32"],
"dependencies": {
"bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1",
"bindbc-freetype": "~>1.2.2",
"bindbc-sdl": "~>1.4.5",
"icontheme": "~>1.2.3"
}
Expand All @@ -103,7 +103,7 @@
"versions-windows": ["Unicode"],
"dependencies": {
"bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1",
"bindbc-freetype": "~>1.2.2",
"bindbc-sdl": "~>1.4.5",
"icontheme": "~>1.2.3"
},
Expand All @@ -123,7 +123,7 @@
"libs-posix": ["GLX"],
"dependencies": {
"bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1",
"bindbc-freetype": "~>1.2.2",
"x11": "~>1.0.21",
"icontheme": "~>1.2.3",
"glx-d": "~>1.1.0"
Expand All @@ -135,7 +135,7 @@
"versions-windows": ["Unicode"],
"dependencies": {
"bindbc-opengl": "~>1.1.0",
"bindbc-freetype": "~>1.1.1",
"bindbc-freetype": "~>1.2.2",
"dsfml": "~>2.1.0",
"icontheme": "~>1.2.3"
},
Expand Down
14 changes: 7 additions & 7 deletions src/dlangui/graphics/ftfonts.d
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,10 @@ class FreeTypeFontFile {


/// 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' )
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) {
dchar replacement = getReplacementChar(code);
if (replacement) {
Expand Down Expand Up @@ -313,7 +313,7 @@ class FreeTypeFontFile {
_face = null;
}

int getKerningOffset(FT_UInt prevCharIndex, FT_UInt nextCharIndex) {
int getKerningOffset(uint prevCharIndex, uint nextCharIndex) {
const FT_KERNING_DEFAULT = 0;
FT_Vector delta;
int error = FT_Get_Kerning( _face, /* handle to face object */
Expand Down Expand Up @@ -372,7 +372,7 @@ class FreeTypeFont : Font {
}

/// 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) {
index = f.getCharIndex(code, def_char);
if (index != 0) {
Expand All @@ -392,11 +392,11 @@ class FreeTypeFont : Font {
override int getKerningOffset(dchar prevChar, dchar currentChar) {
if (!_allowKerning || !prevChar || !currentChar)
return 0;
FT_UInt index1;
uint index1;
FreeTypeFontFile file1;
if (!findGlyph(prevChar, 0, index1, file1))
return 0;
FT_UInt index2;
uint index2;
FreeTypeFontFile file2;
if (!findGlyph(currentChar, 0, index2, file2))
return 0;
Expand All @@ -418,7 +418,7 @@ class FreeTypeFont : Font {
if (found !is null)
return found;
//Log.v("Glyph ", ch, " is not found in cache, getting from font");
FT_UInt index;
uint index;
FreeTypeFontFile file;
if (!findGlyph(ch, 0, index, file)) {
if (!findGlyph(ch, '?', index, file))
Expand Down

0 comments on commit 774f216

Please sign in to comment.