mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-21 12:40:08 +00:00
new option: --override-fstype
This commit is contained in:
parent
1fc7027395
commit
132478c1c1
@ -178,6 +178,12 @@ If set to 1, glyphs narrower than described in PDF will be stretched; otherwise
|
||||
.B --squeeze-wide-glyph <0|1> (Default: 1)
|
||||
If set to 1, glyphs wider than described in PDF will be squeezed; otherwise it will be truncated.
|
||||
|
||||
.TP
|
||||
.B --override-fstype <0|1> (Default: 0)
|
||||
Clear the fstype bits in TTF/OTF fonts.
|
||||
|
||||
Turn this on if Internet Explorer complains about 'Permission must be Installable' AND you have permission to do so.
|
||||
|
||||
.SS Text
|
||||
|
||||
.TP
|
||||
@ -231,6 +237,8 @@ Specify user password
|
||||
.B --no-drm <0|1> (Default: 0)
|
||||
Override document DRM settings
|
||||
|
||||
Turn this on only when you have permission.
|
||||
|
||||
.SS Misc.
|
||||
|
||||
.TP
|
||||
|
@ -561,7 +561,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
|
||||
|
||||
/*
|
||||
* Step 5
|
||||
* Generate the font and load the metrics
|
||||
* Generate the font, load the metrics and set the embeddig bits (fstype)
|
||||
*
|
||||
* Ascent/Descent are not used in PDF, and the values in PDF may be wrong or inconsistent (there are 3 sets of them)
|
||||
* We need to reload in order to retrieve/fix accurate ascent/descent, some info won't be written to the font by fontforge until saved.
|
||||
@ -575,6 +575,8 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
|
||||
|
||||
ffw_load_font(cur_tmp_fn.c_str());
|
||||
ffw_metric(&info.ascent, &info.descent);
|
||||
if(param.override_fstype)
|
||||
ffw_override_fstype();
|
||||
ffw_save(fn.c_str());
|
||||
|
||||
ffw_close();
|
||||
|
@ -48,6 +48,7 @@ struct Param
|
||||
std::string external_hint_tool;
|
||||
int stretch_narrow_glyph;
|
||||
int squeeze_wide_glyph;
|
||||
int override_fstype;
|
||||
|
||||
// text
|
||||
double h_eps, v_eps;
|
||||
|
@ -131,6 +131,7 @@ void parse_options (int argc, char **argv)
|
||||
.add("external-hint-tool", ¶m.external_hint_tool, "", "external tool for hinting fonts (overrides --auto-hint)")
|
||||
.add("stretch-narrow-glyph", ¶m.stretch_narrow_glyph, 0, "stretch narrow glyphs instead of padding them")
|
||||
.add("squeeze-wide-glyph", ¶m.squeeze_wide_glyph, 1, "shrink wide glyphs instead of truncating them")
|
||||
.add("override-fstype", ¶m.override_fstype, 0, "clear the fstype bits in TTF/OTF fonts")
|
||||
|
||||
// text
|
||||
.add("heps", ¶m.h_eps, 1.0, "horizontal threshold for merging text, in pixels")
|
||||
|
@ -414,3 +414,10 @@ void ffw_auto_hint(void)
|
||||
FVAutoHint(cur_fv);
|
||||
FVAutoInstr(cur_fv);
|
||||
}
|
||||
|
||||
void ffw_override_fstype(void)
|
||||
{
|
||||
*(int16 *)(&cur_fv->sf->pfminfo.fstype) = 0;
|
||||
cur_fv->sf->pfminfo.pfmset = true;
|
||||
cur_fv->sf->changed = true;
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ void ffw_set_widths(int * width_list, int mapping_len,
|
||||
////////////////////////
|
||||
// others
|
||||
void ffw_auto_hint(void);
|
||||
void ffw_override_fstype(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user