mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-10-05 19:41:40 +00:00
add encoding confliction warning in the 2nd phase
This commit is contained in:
parent
b9e954eccb
commit
5cf7f2fdf2
@ -214,7 +214,6 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo &
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// move the slot such that it's consistent with the encoding seen in PDF
|
// move the slot such that it's consistent with the encoding seen in PDF
|
||||||
|
|
||||||
unordered_set<string> nameset;
|
unordered_set<string> nameset;
|
||||||
bool name_conflict_warned = false;
|
bool name_conflict_warned = false;
|
||||||
|
|
||||||
@ -284,10 +283,12 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo &
|
|||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
unordered_set<int> codeset;
|
||||||
|
bool name_conflict_warned = false;
|
||||||
|
|
||||||
auto ctu = font->getToUnicode();
|
auto ctu = font->getToUnicode();
|
||||||
memset(cur_mapping, 0, maxcode * sizeof(int32_t));
|
memset(cur_mapping, 0, maxcode * sizeof(int32_t));
|
||||||
|
|
||||||
|
|
||||||
if(code2GID)
|
if(code2GID)
|
||||||
maxcode = min(maxcode, code2GID_len - 1);
|
maxcode = min(maxcode, code2GID_len - 1);
|
||||||
|
|
||||||
@ -322,8 +323,20 @@ void HTMLRenderer::embed_font(const path & filepath, GfxFont * font, FontInfo &
|
|||||||
u = unicode_from_font(i, font);
|
u = unicode_from_font(i, font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(codeset.insert(u).second)
|
||||||
|
{
|
||||||
cur_mapping[k] = u;
|
cur_mapping[k] = u;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!name_conflict_warned)
|
||||||
|
{
|
||||||
|
name_conflict_warned = true;
|
||||||
|
//TODO: may be resolved using advanced font properties?
|
||||||
|
cerr << "Warning: encoding confliction detected in font: " << hex << info.id << dec << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ff_reencode_raw(cur_mapping, max_key + 1, 1);
|
ff_reencode_raw(cur_mapping, max_key + 1, 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user