From 769f081609f7c3e6b594c242fe5da104df08381a Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 4 May 2013 22:05:43 +0800 Subject: [PATCH 1/4] set std glyph name when creating empty char --- src/util/ffw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/ffw.c b/src/util/ffw.c index 1be092c..4a2d679 100644 --- a/src/util/ffw.c +++ b/src/util/ffw.c @@ -267,7 +267,11 @@ void ffw_cidflatten(void) void ffw_add_empty_char(int32_t unicode, int width) { SplineChar * sc = SFMakeChar(cur_fv->sf, cur_fv->map, cur_fv->map->enccount); - SCSetMetaData(sc, sc->name, unicode, sc->comment); + char buffer[400]; + SCSetMetaData(sc, + strcopy(StdGlyphName(buffer, unicode, + cur_fv->sf->uni_interp, cur_fv->sf->for_new_glyphs)), + unicode, sc->comment); SCSynchronizeWidth(sc, width, sc->width, cur_fv); } From 12f2b974457857f1287b1e2c1c9e15c79a9c361c Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 4 May 2013 23:09:49 +0800 Subject: [PATCH 2/4] fix space width for IE --- src/HTMLRenderer/font.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/HTMLRenderer/font.cc b/src/HTMLRenderer/font.cc index ccd74ce..f13fac6 100644 --- a/src/HTMLRenderer/font.cc +++ b/src/HTMLRenderer/font.cc @@ -493,6 +493,19 @@ void HTMLRenderer::embed_font(const string & filepath, GfxFont * font, FontInfo } } + if(info.space_width == 0) + { + /* + * Internet Explorer will ignore `word-spacing` if + * the width of the 'space' glyph is 0 + * + * usually the em_size is 1000 or 2048, + * and space_width==0 often means no spaces are used in the PDF + * so setting it to be 1 should be safe + */ + info.space_width = 1; + } + if(ctu) ctu->decRefCnt(); } From 8ba1e0de14e6172f7fa55963178c9923af0e3577 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 4 May 2013 23:32:07 +0800 Subject: [PATCH 3/4] update demo description --- README.md | 10 +++++----- TODO | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4e0f833..fcd56b3 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ A beautiful demo is worth a thousand words: -- **Typography**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/geneve.html) / [MediaFire](http://www.mediafire.com/view/?fqbc2d2o1kdz51a) / [Original](https://github.com/raphink/geneve_1564/raw/master/geneve_1564.pdf) -- **Formulas**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/cheat.html) / [MediaFire](http://www.mediafire.com/view/?84vdgrepkxclbq2) / [Original](http://www.tug.org/texshowcase/cheat.pdf) -- **Scientific Paper**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [MediaFire](http://www.mediafire.com/view/?6po429kz9czcga2) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) -- **Full Circle Magazine**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html)might be slow / [MediaFire](http://www.mediafire.com/view/?6hxmt94k2vppnpb) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) -- **Chinese**: [Default](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [MediaFire](http://www.mediafire.com/view/?6550ldag9w0uuq3) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) +- [**Typography**: generated by LaTeX](http://coolwanglu.github.com/pdf2htmlEX/demo/geneve.html) / [Original](https://github.com/raphink/geneve_1564/raw/master/geneve_1564.pdf) +- [**Cheat Sheet**: complicated math formulas](http://coolwanglu.github.com/pdf2htmlEX/demo/cheat.html) / [Original](http://www.tug.org/texshowcase/cheat.pdf) +- [**Scientific Paper**: text and figures](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) +- [**Full Circle Magazine**: read while downloaing](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) +- [**Git Manual**: CJK support](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) - [Try your own files](https://github.com/coolwanglu/pdf2htmlEX/wiki/UploadDemo) [Browser requirements](https://github.com/coolwanglu/pdf2htmlEX/wiki/Browser-Requirements) diff --git a/TODO b/TODO index 9fd4604..8eb6374 100644 --- a/TODO +++ b/TODO @@ -8,6 +8,8 @@ - show hints about possible useful parameters - optimization levels - don't dump image when it is empty + - spinning icon for dynamic page loading + - fix negative word-spacing for IE == Future: == From 7b833ea14074146d210389851f60bc731df33056 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sat, 4 May 2013 23:39:08 +0800 Subject: [PATCH 4/4] update demo description --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fcd56b3..8de88cb 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ A beautiful demo is worth a thousand words: -- [**Typography**: generated by LaTeX](http://coolwanglu.github.com/pdf2htmlEX/demo/geneve.html) / [Original](https://github.com/raphink/geneve_1564/raw/master/geneve_1564.pdf) -- [**Cheat Sheet**: complicated math formulas](http://coolwanglu.github.com/pdf2htmlEX/demo/cheat.html) / [Original](http://www.tug.org/texshowcase/cheat.pdf) -- [**Scientific Paper**: text and figures](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [Original](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) -- [**Full Circle Magazine**: read while downloaing](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [Original](http://dl.fullcirclemagazine.org/issue65_en.pdf) -- [**Git Manual**: CJK support](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [Original](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) +- **Typography** (LaTeX): [HTML](http://coolwanglu.github.com/pdf2htmlEX/demo/geneve.html) / [PDF](https://github.com/raphink/geneve_1564/raw/master/geneve_1564.pdf) +- **Cheat Sheet** (math formulas): [HTML](http://coolwanglu.github.com/pdf2htmlEX/demo/cheat.html) / [PDF](http://www.tug.org/texshowcase/cheat.pdf) +- **Scientific Paper** (text and figures): [HTML](http://coolwanglu.github.com/pdf2htmlEX/demo/demo.html) / [PDF](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.148.349&rep=rep1&type=pdf) +- **Full Circle Magazine** (read while downloading): [HTML](http://coolwanglu.github.com/pdf2htmlEX/demo/issue65_en.html) / [PDF](http://dl.fullcirclemagazine.org/issue65_en.pdf) +- **Git Manual** (CJK support): [HTML](http://coolwanglu.github.com/pdf2htmlEX/demo/chn.html) / [PDF](http://files.cnblogs.com/phphuaibei/git%E6%90%AD%E5%BB%BA.pdf) - [Try your own files](https://github.com/coolwanglu/pdf2htmlEX/wiki/UploadDemo) [Browser requirements](https://github.com/coolwanglu/pdf2htmlEX/wiki/Browser-Requirements)