texjporg / uplatex

upLaTeX community edition
BSD 3-Clause "New" or "Revised" License
18 stars 0 forks source link

Question: How to let dvipdfmx use the correct width as indicated by vf? #4

Closed DavidFangWJ closed 6 years ago

DavidFangWJ commented 6 years ago

I am trying to test upLaTeX with Chinese, and I have made the correct settings for jfm and vf (vf was modified for certain characters, but jfm was the same as "upschrm-h" except for the name), and the result was undesirable. According to the PDF output, not only was the "modified graph" incorrect, the unmodified (for example, comma) was also incorrect that certain characters overlapped. My hypothesis is that the dvi file recorded the coordinate based on tfm width, with the latter characters being defined as "following" the former; while when passing by dvipdfmx, they used the real width of the font, hence the issue. image Notice that the first line "Senior 2, Class, 21, (my name)" is correctly centered, while the second line "2019 (planned)" was wrong from the parentheses. This is my hypothesis: For example, suppose there are only "甲、乙AB". The dvi correctly sees "甲、" as 1.5zw and gives a 0.5zw space. Then since the length of \xkanjiskip is calculated, and "A" is again defined by absolute coordinates. Then when converted to pdf, the dvipdfmx sees from ttf file and assume that "甲、" is 2zw. Thus, the width of "、" became 1.5zw in reality, and "乙" is overlapping with "A".

My question is, how can I place the information of vf in .map file or dvipdfmx command line, so that I can get a correct result?

This is the MWE. Also in my comment below. MWE.zip

aminophen commented 6 years ago

I am trying to test upLaTeX with Chinese, and I have made the correct settings for jfm and vf (vf was modified for certain characters, but jfm was the same as "upschrm-h" except for the name), and the result was undesirable.

Please give a sample MWE (set of .tex, .tfm, .vf) which can easily reproduce the problem here

DavidFangWJ commented 6 years ago

Please give a sample MWE (set of .tex, .tfm, .vf) which can easily reproduce the problem here

@aminophen Here is my MWE, and it is easy to see that the listing comma has an unnaturally large space after it. The font "fzssk.ttf" is a common used font in China, and it can be downloaded here.

MWE.zip

the vf is changed from upschrm-h, and the tfm is just a rename of upschrm-h.

The changes I made in vf, for better typesetting are:

Shift the glyph for 1/8zw for 《〈〉》 Shift the glyph for 1/6zw for most brackets Shift the glyph for 1/4zw for full-width braces ({}; I cannot type it here)

The commands I use are:

uplatex a.tex dvipdfmx -f uptex-Founder.map a.dvi

DavidFangWJ commented 6 years ago

New discovery: if I define “uprml” instead (and without “fzss” command), the punctuation spacing will be correct, although it will use the default vf. Is there any way that I can correctly use my own vf instead? @aminophen

DavidFangWJ commented 6 years ago

Here are something that I tried and modified on the mwe:

  1. Does not specify a new font family, but map “uprml-h” to fzssk in map file. The spacing of listing comma looks right, but it is unable to modify the punctuations I listed above.
  2. Specify a new font family, and override the \mcdefault. The spacing looks wrong.

I am pretty sure that dvipdfmx can recognize the default tam and vf, but cannot for my own vf (generated by jfmutils). I hope there is a way to fix it.

DavidFangWJ commented 6 years ago

This is my zvp source file (as required by Aling Li):

fzss_zvp.zip

DavidFangWJ commented 6 years ago

I have understood that the problem is caused by my ignorance of font schemes, and now it has been solved.