Skip to content

Commit

Permalink
UPBGE: Fix loading of font for object in linked libraries.
Browse files Browse the repository at this point in the history
Previously the loading of the font was using the library path (exactly the
main path) of the first library converted, but in case of lib loading or
linked library the path was invalid. To fix this issue we use the id.lib->filepath
from the vfont passed to the function GetFont.

Fix issue #377.
  • Loading branch information
panzergame committed Mar 7, 2017
1 parent be18828 commit 6f8c7af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/gameengine/Ketsji/KX_FontObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ int GetFontId(VFont *vfont)
}

// convert from absolute to relative
char expanded[256]; // font names can be bigger than FILE_MAX (240)
BLI_strncpy(expanded, filepath, 256);
BLI_path_abs(expanded, KX_GetMainPath().c_str());
char expanded[FILE_MAX];
BLI_strncpy(expanded, filepath, FILE_MAX);
BLI_path_abs(expanded, vfont->id.lib->filepath);

fontid = BLF_load(expanded);

Expand Down

0 comments on commit 6f8c7af

Please sign in to comment.