>>>> The problem does not appear if the cairo backend is used, see
>>>> https://gitlab.com/lilypond/lilypond/-/merge_requests/853.
>>>
>>> This is good news!
>>
>> When copying and pasting from a PDF generated using cairo backend,
>> some characters turned into similar but different characters. The
>> characters are garbled in both AJ1 and AI0 fonts. If you use ps
>> backend, characters by the AJ1 font are not garbled. [...]
>
> I've looked up the cairo bug tracker but couldn't find something
> related to copy-and-paste of CID-keyed fonts. Masamichi-san, could
> you submit an issue there so that this gets fixed eventually? I guess
> this would be beneficial for other projects, too.
In my experiment, Cairo without LilyPond does not generate garbled characters.
It seems to be a LilyPond issue instead of a Cairo issue.
Here's a python-cairo sample that works fine.
```
#!/bin/env python3
import cairo
def main():
with cairo.PDFSurface("test.pdf", 300, 100) as surface:
context = cairo.Context(surface)
context.select_font_face("Noto Serif CJK JP")
context.set_font_size(12)
context.move_to(12, 24)
context.show_text("初見はハ長調で高音の白玉があった")
context.select_font_face("HaranoAjiMincho")
context.set_font_size(12)
context.move_to(12, 48)
context.show_text("初見はハ長調で高音の白玉があった")
surface.show_page()
if __name__ == '__main__':
main ()
```
_______________________________________________
bug-lilypond mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-lilypond