michal-h21 / luatex-harfbuzz-shaper

Experimental text shaping in LuaTeX using Harfbuzz library
10 stars 0 forks source link

Some problems with the scripts.tex example #7

Closed deepakjois closed 8 years ago

deepakjois commented 8 years ago

I finally updated my TeXLive environment, and got the latest LaTeX all setup. I can now run the examples fine. But I am seeing some problems when I run lualatex examples/scripts.tex.

Take a look at the attached scripts.pdf

Noto Nastaliq, Hebrew and Tamil seem to be a bit off. Not sure why.

michal-h21 commented 8 years ago

I am not sure what you mean by "to be a bit off". Hebrew seems good to me, Tamil seems to be badly shaped, when I compare scripts.pdf with output of hb.view.

deepakjois commented 8 years ago

Ok, I get the real problem now. It seems to be not displaying properly in OS X Preview. Here is a screenshot of how Urdu looks (Same with Hebrew and Tamil)

screenshot 2015-12-13 15 34 40

I just checked in Chrome’s native PDF viewer, and it displays fine. So either something is wrong in Preview app (the default PDF viewer on OS X), or the fonts are being embedded in a way that Preview is not able to render it properly.

While this is not as bad a problem, its still a bit weird that Preview cannot render some glyphs in the generated PDF. I will dig further when I get the time. Meanwhile, if you have any clues, do let me know.

deepakjois commented 8 years ago

Here is how it looks on Chrome PDF Viewer, which is good.

screenshot 2015-12-13 15 44 57
michal-h21 commented 8 years ago

It might be related to this issue:

pdffonts command reports this error message on examples/scripts.pdf:

  $ Syntax Error (103800): Dictionary key must be a name object
  Syntax Error (103834): Dictionary key must be a name object
  Syntax Error (103858): Dictionary key must be a name object
  Syntax Error (104209): Dictionary key must be a name object
  Syntax Error (104241): Dictionary key must be a name object
  Syntax Error (104253): Dictionary key must be a name object
michal-h21 commented 8 years ago

I've figured out what was wrong with Tamil example: tami script was used, correct one is taml

dohyunkim commented 8 years ago

about pdffonts error message, it seems that we have to specify psname in fontloader.loader.

diff --git a/hb_fontload.lua b/hb_fontload.lua
index 59c9299..74c7aec 100644
--- a/hb_fontload.lua
+++ b/hb_fontload.lua
@@ -60,6 +60,7 @@ function M.loader(specification, size)
     if ttffont then
       f = { }
       f.name = ttffont.fontname
+      f.psname = f.name
       f.spec = spec
       if spec.fullpath then
         f.face = Face.new(spec.fullpath)
michal-h21 commented 8 years ago

@dohyunkim thanks, it seems to solve the issue.

@deepakjois , does the change fix problem in OS X Preview?

deepakjois commented 8 years ago

@michal-h21 Yes it does. Thanks @dohyunkim

Closing issue.