Can't no break between a close punctuation and a open punctuation
I sent this email four days ago and it may not have been delivered? --------------------------------------------------------------------------------------- Dear Hans, I found that ConTeXt injected two infinity penalties between a close punctuation and a open punctuation, for example between `”` and `“`, or between `:` and `“`, so can not break at these places, as showed in following doc. But actually, we may sometimes need to do so. Please note that there is no space around full width punctuations in Chinese document. doc for example: ```lmtx \setscript[hanzi] \usetypescriptfile[mscore] \usebodyfont [mschinese,20pt] \showframe \starttext \dorecurse{5}{“好?!;”“:,。”} % linebreak sutck \dorecurse{30}{“我”} % linebreak sutck \dorecurse{30}{我} % linebreak work \dorecurse{30}{我。} % linebreak work \stoptext ``` What I see between any two consecutive punctuations are <penalty userpenalty> 10000 <glue userskip> 0 0 655500 <penalty userpenalty> 10000 <glue userskip> 0 655500 0 so nowhere to linebreak. Thanks. Huang Fusyong(黄复雄) ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net __________________________________________________________________________________
On 8/2/2022 9:06 AM, 黄复雄 via ntg-context wrote:
I sent this email four days ago and it may not have been delivered? ---------------------------------------------------------------------------------------
Dear Hans,
I found that ConTeXt injected two infinity penalties between a close punctuation and a open punctuation, for example between `”` and `“`, or between `:` and `“`, so can not break at these places, as showed in following doc. But actually, we may sometimes need to do so. Please note that there is no space around full width punctuations in Chinese document.
you can try this in scrp-cjk.lua (remake the format) local chinese_8 = { jami_initial = nobreak_shrink_break_stretch, korean = nobreak_autoshrink_break_stretch, chinese = stretch_break, -- nobreak_autoshrink_break_stretch, hiragana = stretch_break, -- nobreak_autoshrink_break_stretch, katakana = stretch_break, -- nobreak_autoshrink_break_stretch, half_width_open = nobreak_autoshrink_break_stretch_nobreak_autoshrink, half_width_open = stretch_break, half_width_close = nobreak_autoshrink_nobreak_stretch, full_width_open = nobreak_autoshrink_break_stretch_nobreak_shrink, full_width_close = nobreak_autoshrink_nobreak_stretch, full_width_punct = nobreak_autoshrink_nobreak_stretch, hyphen = nobreak_autoshrink_break_stretch, non_starter = nobreak_autoshrink_break_stretch, other = nobreak_autoshrink_break_stretch, }
doc for example:
```lmtx \setscript[hanzi] \usetypescriptfile[mscore] \usebodyfont [mschinese,20pt]
can you upgrade the chiese section in that file for windows 10+ as the old fonts are gone (i tested with \definedfont[file:mingliu.ttc*chinese @ 10pt]) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Dear Hans,
I found that ConTeXt injected two infinity penalties between a close punctuation and a open punctuation, for example between `”` and `“`, or between `:` and `“`, so can not break at these places, as showed in following doc. But actually, we may sometimes need to do so. Please note that there is no space around full width punctuations in Chinese document.
you can try this in scrp-cjk.lua (remake the format)
local chinese_8 = { jami_initial = nobreak_shrink_break_stretch, korean = nobreak_autoshrink_break_stretch, chinese = stretch_break, -- nobreak_autoshrink_break_stretch, hiragana = stretch_break, -- nobreak_autoshrink_break_stretch, katakana = stretch_break, -- nobreak_autoshrink_break_stretch, half_width_open = nobreak_autoshrink_break_stretch_nobreak_autoshrink, half_width_open = stretch_break, half_width_close = nobreak_autoshrink_nobreak_stretch, full_width_open = nobreak_autoshrink_break_stretch_nobreak_shrink, full_width_close = nobreak_autoshrink_nobreak_stretch, full_width_punct = nobreak_autoshrink_nobreak_stretch, hyphen = nobreak_autoshrink_break_stretch, non_starter = nobreak_autoshrink_break_stretch, other = nobreak_autoshrink_break_stretch, }
Thanks to your guidance, I solved the problem. And I would like to look into some other related issues that I have doubts about and get back to you together. So I need some more time.
doc for example:
```lmtx \setscript[hanzi] \usetypescriptfile[mscore] \usebodyfont [mschinese,20pt]
can you upgrade the chiese section in that file for windows 10+ as the old fonts are gone
(i tested with \definedfont[file:mingliu.ttc*chinese @ 10pt])
Sorry, when you say ` that file for windows 10+`, which one are you referring to? to scrp-cjk.lua?( yes, I will upgrade it.) or to my lmtx doc for testing?(It work fine in my Windows 10.) or to type-imp-mscore.mkiv? (It work fine in my Windows 10, and no mingliu.ttc in it.) Thanks. Huang Fusyong(黄复雄) ------------------------------------------------------------------------------------------------------- If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net -------------------------------------------------------------------------------------------------------
Sorry, when you say ` that file for windows 10+`, which one are you referring to? to scrp-cjk.lua?( yes, I will upgrade it.) or to my lmtx
On 8/2/2022 4:08 PM, 黄复雄 via ntg-context wrote: the chinese font .. as defined in type-imp-mscore ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
doc for example:
```lmtx \setscript[hanzi] \usetypescriptfile[mscore] \usebodyfont [mschinese,20pt]
can you upgrade the chiese section in that file for windows 10+ as the old fonts are gone
(i tested with \definedfont[file:mingliu.ttc*chinese @ 10pt])
I adapted type-imp-mscore.mkiv to the situation of the fonts in Win10, and made type-imp-notocjksc.mkiv according to the Notocjksc fonts. I refer to type-imp-ipaex.mkiv, and I don't know if the method in it is outdated. At least, the test results are fine, though the resulting PDF is a bit too large to be included in this email. ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________
you can try this in scrp-cjk.lua (remake the format)
local chinese_8 = { jami_initial = nobreak_shrink_break_stretch, korean = nobreak_autoshrink_break_stretch, chinese = stretch_break, -- nobreak_autoshrink_break_stretch, hiragana = stretch_break, -- nobreak_autoshrink_break_stretch, katakana = stretch_break, -- nobreak_autoshrink_break_stretch, half_width_open = nobreak_autoshrink_break_stretch_nobreak_autoshrink, half_width_open = stretch_break, half_width_close = nobreak_autoshrink_nobreak_stretch, full_width_open = nobreak_autoshrink_break_stretch_nobreak_shrink, full_width_close = nobreak_autoshrink_nobreak_stretch, full_width_punct = nobreak_autoshrink_nobreak_stretch, hyphen = nobreak_autoshrink_break_stretch, non_starter = nobreak_autoshrink_break_stretch, other = nobreak_autoshrink_break_stretch, }
Dear Hans, I have modified these two files, scrp-cjk.lua and char-scr.lua. In the modified lines, some comments were made, but not all of these places were commented. If you need to mark all the places, please let me know and I'll mark all the changes. As I've said last time, what I've done may be a bit reckless, please check and correct it. Though I've done some testing, but obviously it is not very comprehensive. With best regards, 黄复雄(Huang Fusyong) ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________
participants (2)
-
Hans Hagen
-
黄复雄