Skip to content

Commit

Permalink
Add LAF_FREETYPE to laf-ft to know if freetype headers are available
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Apr 8, 2024
1 parent 0af1f8b commit d9afe21
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ target_include_directories(laf-ft
PUBLIC
${FREETYPE_INCLUDE_DIRS}
${HARFBUZZ_INCLUDE_DIRS})

target_compile_definitions(laf-ft PUBLIC LAF_FREETYPE)
9 changes: 7 additions & 2 deletions os/draw_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@

#include "os/draw_text.h"

#include "ft/algorithm.h"
#include "ft/hb_shaper.h"
#if LAF_FREETYPE
#include "ft/algorithm.h"
#include "ft/hb_shaper.h"
#endif

#include "gfx/clip.h"
#include "os/common/freetype_font.h"
#include "os/common/generic_surface.h"
Expand Down Expand Up @@ -104,6 +107,7 @@ retry:;
}

case FontType::FreeType: {
#if LAF_FREETYPE
FreeTypeFont* ttFont = static_cast<FreeTypeFont*>(font);
const int fg_alpha = gfx::geta(fg);

Expand Down Expand Up @@ -229,6 +233,7 @@ retry:;

if (surface)
surface->unlock();
#endif // LAF_FREETYPE
break;
}

Expand Down

0 comments on commit d9afe21

Please sign in to comment.