mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-22 04:50:09 +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)
|
.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.
|
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
|
.SS Text
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
@ -231,6 +237,8 @@ Specify user password
|
|||||||
.B --no-drm <0|1> (Default: 0)
|
.B --no-drm <0|1> (Default: 0)
|
||||||
Override document DRM settings
|
Override document DRM settings
|
||||||
|
|
||||||
|
Turn this on only when you have permission.
|
||||||
|
|
||||||
.SS Misc.
|
.SS Misc.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
|
@ -561,7 +561,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 5
|
* 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)
|
* 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.
|
* 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_load_font(cur_tmp_fn.c_str());
|
||||||
ffw_metric(&info.ascent, &info.descent);
|
ffw_metric(&info.ascent, &info.descent);
|
||||||
|
if(param.override_fstype)
|
||||||
|
ffw_override_fstype();
|
||||||
ffw_save(fn.c_str());
|
ffw_save(fn.c_str());
|
||||||
|
|
||||||
ffw_close();
|
ffw_close();
|
||||||
|
@ -48,6 +48,7 @@ struct Param
|
|||||||
std::string external_hint_tool;
|
std::string external_hint_tool;
|
||||||
int stretch_narrow_glyph;
|
int stretch_narrow_glyph;
|
||||||
int squeeze_wide_glyph;
|
int squeeze_wide_glyph;
|
||||||
|
int override_fstype;
|
||||||
|
|
||||||
// text
|
// text
|
||||||
double h_eps, v_eps;
|
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("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("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("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
|
// text
|
||||||
.add("heps", ¶m.h_eps, 1.0, "horizontal threshold for merging text, in pixels")
|
.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);
|
FVAutoHint(cur_fv);
|
||||||
FVAutoInstr(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
|
// others
|
||||||
void ffw_auto_hint(void);
|
void ffw_auto_hint(void);
|
||||||
|
void ffw_override_fstype(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user