Skip to content

Commit

Permalink
bump crengine: support for font-family to font name mapping (#1526)
Browse files Browse the repository at this point in the history
Includes:
- CSS parsing: accept (and ignore) namesspaces
- isImage(): more checks for <object> as it can have inner content
- getFontFileNameAndFaceIndex(): returns if font has math support
- getFontFileNameAndFaceIndex(): returns if font has emojis
- CSS/Fonts: add support for font-family to font name mapping
  • Loading branch information
poire-z committed Oct 3, 2022
1 parent 99143a2 commit bdc6cb8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1416,12 +1416,16 @@ static int getFontFaceFilenameAndFaceIndex(lua_State *L) {
lString8 filename;
int faceindex = -1;
int family = -1;
bool found = fontMan->getFontFileNameAndFaceIndex(lString32(facename), bold, italic, filename, faceindex, family);
bool has_ot_math = false;
bool has_emojis = false;
bool found = fontMan->getFontFileNameAndFaceIndex(lString32(facename), bold, italic, filename, faceindex, family, has_ot_math, has_emojis);
if (found) {
lua_pushstring(L, filename.c_str());
lua_pushinteger(L, faceindex);
lua_pushboolean(L, family == css_ff_monospace);
return 3;
lua_pushboolean(L, has_ot_math);
lua_pushboolean(L, has_emojis);
return 5;
}

return 0;
Expand Down

0 comments on commit bdc6cb8

Please sign in to comment.