>> When using certain fonts (in my case, Noto CJK, both pan-CJK and
>> subset versions), the output looks right but when copied from the
>> generated PDF file, everything becomes garbage.  [...]
> 
> Confirmed.
> 
>> It seems to be all about CID. Maybe related to Issue #6058?
> 
> Yes and no.  The fix for #6058 was to make CID fonts display correctly
> at all.  AFAICS, to make copy and paste work for CID fonts it is
> necessary to add a ToUnicode map.  We don't do that currently.  [This
> is probably worth an entry in our issues database.]  Masamichi-san,
> please correct me if I am wrong.

Yes, you need ToUnicode CMap to copy and paste characters
from Adobe-Identity-0 (AI0) fonts.
Current LilyPond does not embed the ToUnicode CMap.
Noto CJK is an AI0 font. 
Therefore, you cannot copy and paste.

If the font is not AI0, but Adobe-GB1 (AG1), Adobe-Japan1 (AJ1), etc.,
you do not necessarily need the ToUnicode CMap for copy and paste.

To copy and paste, you can use HaranoAji fonts, which are AG1 or AJ1 fonts.

HaranoAjiFontsCN (AG1 for Simplified Chinese)
https://github.com/trueroad/HaranoAjiFontsCN

HaranoAjiFonts (AJ1 for Japanese)
https://github.com/trueroad/HaranoAjiFonts

Here is a sample.

```
\version "2.22.0"
\markup {
  \override #'(font-name . "HaranoAjiMincho")
  {English}
  \override #'(font-name . "HaranoAjiMinchoCN") % For Simplified Chinese
  {中文}
  \override #'(font-name . "HaranoAjiMincho") % For Japanese
  {にほんご}
}
```
_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to