Skip to content

Commit

Permalink
added fallback for missing chars in ofm-based VF files
Browse files Browse the repository at this point in the history
as described in GH issue #241
  • Loading branch information
mgieseki committed May 10, 2023
1 parent 2be56bf commit 2ab9ee2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/DVIReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,11 @@ void DVIReader::putVFChar (Font *font, uint32_t c) {
FontManager &fm = FontManager::instance();
const vector<uint8_t> *dvi = vf->getDVI(c); // try to get DVI snippet that represents character c
Font *firstFont = fm.vfFirstFont(vf);
if (!dvi && (!firstFont || !firstFont->getMetrics() || !firstFont->getMetrics()->isJFM()))
return;
if (!dvi) {
const FontMetrics *ffm = firstFont ? firstFont->getMetrics() : nullptr;
if (!ffm || (!ffm->isJFM() && !ffm->isOFM()))
return;
}
fm.enterVF(vf); // enter VF font number context
int savedFontNum = _currFontNum; // save current font number
setFont(fm.vfFirstFontNum(vf), SetFontMode::VF_ENTER);
Expand Down

0 comments on commit 2ab9ee2

Please sign in to comment.