Skip to content

Commit

Permalink
Freetype / PlutoSvg: PlutoSVG's FreeType hooks are now located in a d…
Browse files Browse the repository at this point in the history
…edicated header

This commit adapts to the new way to handle Freetype hooks within PlutoSvg 0.0.5: see https://github.com/sammycage/plutosvg/releases/tag/v0.0.5

Note: the old way (i.e. using PLUTOSVG_HAS_FREETYPE when compiling PlutoSvg) still works atm, but is deprecated.
  • Loading branch information
pthom committed Feb 12, 2025
1 parent df2b6d6 commit 0131322
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion misc/freetype/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,5 @@ _Compilation hints for plutovg_
_Compilation hints for plutosvg_
- Compile `plutosvg/source/plutosvg.c`
- Add include directory: `plutosvg/source`
- Add define: `PLUTOSVG_HAS_FREETYPE`
- Link with: plutovg, freetype

4 changes: 2 additions & 2 deletions misc/freetype/imgui_freetype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include <lunasvg.h>
#endif
#ifdef IMGUI_ENABLE_FREETYPE_PLUTOSVG
#include <plutosvg.h>
#include <plutosvg-ft.h>
#endif
#if defined(IMGUI_ENABLE_FREETYPE_LUNASVG) || defined (IMGUI_ENABLE_FREETYPE_PLUTOSVG)
#if !((FREETYPE_MAJOR >= 2) && (FREETYPE_MINOR >= 12))
Expand Down Expand Up @@ -826,7 +826,7 @@ static bool ImFontAtlasBuildWithFreeType(ImFontAtlas* atlas)
#endif // IMGUI_ENABLE_FREETYPE_LUNASVG
#ifdef IMGUI_ENABLE_FREETYPE_PLUTOSVG
// With plutosvg, use provided hooks
FT_Property_Set(ft_library, "ot-svg", "svg-hooks", plutosvg_ft_svg_hooks());
FT_Property_Set(ft_library, "ot-svg", "svg-hooks", &plutosvg_ft_hooks);
#endif // IMGUI_ENABLE_FREETYPE_PLUTOSVG

bool ret = ImFontAtlasBuildWithFreeTypeEx(ft_library, atlas, atlas->FontBuilderFlags);
Expand Down

0 comments on commit 0131322

Please sign in to comment.