mirror of
https://github.com/pdf2htmlEX/pdf2htmlEX.git
synced 2024-12-21 20:50:07 +00:00
removed '--remove-unused-glyph'
This commit is contained in:
parent
4a7e067059
commit
29ba79a378
@ -7,8 +7,9 @@ Developing v0.9
|
||||
* New options:
|
||||
--embed
|
||||
--embed-***
|
||||
* Deprecated options:
|
||||
* Deprecated/Removed options:
|
||||
--single-html
|
||||
--remove-unused-glyph
|
||||
|
||||
v0.8
|
||||
2013.05.05
|
||||
|
@ -158,12 +158,6 @@ Specify the suffix of fonts extracted from the PDF file.
|
||||
.B --decompose-ligature <0|1> (Default: 0)
|
||||
Decompose ligatures. For example 'fi' -> 'f''i'.
|
||||
|
||||
.TP
|
||||
.B --remove-unused-glyph <0|1> (Default: 0)
|
||||
If set to 1, remove unused glyphs in embedded fonts in order to reduce the file size.
|
||||
|
||||
Currently this option is experimental, turning it on may cause segmentation fault or debris-like fonts.
|
||||
|
||||
.TP
|
||||
.B --auto-hint <0|1> (Default: 0)
|
||||
If set to 1, hints will be generated for the fonts using fontforge.
|
||||
|
@ -470,7 +470,7 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo
|
||||
}
|
||||
}
|
||||
|
||||
ffw_set_widths(width_list, max_key + 1, param.stretch_narrow_glyph, param.squeeze_wide_glyph, param.remove_unused_glyph);
|
||||
ffw_set_widths(width_list, max_key + 1, param.stretch_narrow_glyph, param.squeeze_wide_glyph);
|
||||
|
||||
ffw_reencode_raw(cur_mapping, max_key + 1, 1);
|
||||
|
||||
|
@ -44,7 +44,6 @@ struct Param
|
||||
int embed_external_font;
|
||||
std::string font_suffix;
|
||||
int decompose_ligature;
|
||||
int remove_unused_glyph;
|
||||
int auto_hint;
|
||||
std::string external_hint_tool;
|
||||
int stretch_narrow_glyph;
|
||||
|
@ -42,6 +42,12 @@ void deprecated_single_html(const char * dummy = nullptr)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void removed_remove_unsed_glyph(const char * dummy = nullptr)
|
||||
{
|
||||
cerr << "--remove-unsed-glyph is removed. Use a PDF optimization tool instead." << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void show_usage_and_exit(const char * dummy = nullptr)
|
||||
{
|
||||
cerr << "Usage: pdf2htmlEX [options] <input.pdf> [<output.html>]" << endl;
|
||||
@ -121,7 +127,6 @@ void parse_options (int argc, char **argv)
|
||||
.add("embed-external-font", ¶m.embed_external_font, 1, "embed local match for external fonts")
|
||||
.add("font-suffix", ¶m.font_suffix, ".ttf", "suffix for embedded font files (.ttf,.otf,.woff,.svg)")
|
||||
.add("decompose-ligature", ¶m.decompose_ligature, 0, "decompose ligatures, such as \uFB01 -> fi")
|
||||
.add("remove-unused-glyph", ¶m.remove_unused_glyph, 0, "remove unused glyphs in embedded fonts")
|
||||
.add("auto-hint", ¶m.auto_hint, 0, "use fontforge autohint on fonts without hints")
|
||||
.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")
|
||||
@ -154,6 +159,7 @@ void parse_options (int argc, char **argv)
|
||||
|
||||
// deprecated
|
||||
.add("single-html", "", &deprecated_single_html)
|
||||
.add("remove-unused-glyph", "", &removed_remove_unsed_glyph)
|
||||
|
||||
.add("", ¶m.input_filename, "", "")
|
||||
.add("", ¶m.output_filename, "", "")
|
||||
|
@ -353,11 +353,9 @@ void ffw_metric(double * ascent, double * descent)
|
||||
|
||||
/*
|
||||
* TODO:bitmap, reference have not been considered in this function
|
||||
* TODO:remove_unused may not be suitable to be done here
|
||||
*/
|
||||
void ffw_set_widths(int * width_list, int mapping_len,
|
||||
int stretch_narrow, int squeeze_wide,
|
||||
int remove_unused)
|
||||
int stretch_narrow, int squeeze_wide)
|
||||
{
|
||||
SplineFont * sf = cur_fv->sf;
|
||||
|
||||
@ -367,8 +365,6 @@ void ffw_set_widths(int * width_list, int mapping_len,
|
||||
{
|
||||
printf("TODO: width vs bitmap\n");
|
||||
}
|
||||
|
||||
memset(cur_fv->selected, 0, cur_fv->map->enccount);
|
||||
|
||||
EncMap * map = cur_fv->map;
|
||||
int i;
|
||||
@ -376,11 +372,10 @@ void ffw_set_widths(int * width_list, int mapping_len,
|
||||
for(i = 0; i < imax; ++i)
|
||||
{
|
||||
/*
|
||||
* Do mess with it if the glyphs is not used.
|
||||
* Don't mess with it if the glyphs is not used.
|
||||
*/
|
||||
if(width_list[i] == -1)
|
||||
{
|
||||
cur_fv->selected[i] = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -405,12 +400,6 @@ void ffw_set_widths(int * width_list, int mapping_len,
|
||||
|
||||
SCSynchronizeWidth(sc, width_list[i], sc->width, cur_fv);
|
||||
}
|
||||
|
||||
for(; i < map->enccount; ++i)
|
||||
cur_fv->selected[i] = 1;
|
||||
|
||||
if(remove_unused)
|
||||
FVDetachAndRemoveGlyphs(cur_fv);
|
||||
}
|
||||
|
||||
void ffw_auto_hint(void)
|
||||
|
@ -50,8 +50,7 @@ int ffw_get_em_size(void);
|
||||
void ffw_metric(double * ascent, double * descent);
|
||||
|
||||
void ffw_set_widths(int * width_list, int mapping_len,
|
||||
int stretch_narrow, int squeeze_wide,
|
||||
int remove_unused);
|
||||
int stretch_narrow, int squeeze_wide);
|
||||
|
||||
////////////////////////
|
||||
// others
|
||||
|
Loading…
Reference in New Issue
Block a user