How to merge multi fonts into one ttf?

3,405 views
Skip to first unread message

Wang Dàpéng

unread,
Jul 5, 2015, 2:30:09 AM7/5/15
to noto...@googlegroups.com
Hi, I've learned that it's impossible to have a single ttf for all languages, so I'm trying to make a subset of that, which means merge NotoSans, NotoSansCJKsc, NotoSansCJKjp together.

I found the `merge_noto.py` file and customized the code(to select only the fonts I need), then I coverted `NotoSansCJKsc-Regular.otf` to ttf with fontforge, but when I run merge_noto.py, I still got erros:

Traceback (most recent call last):

  File "merge_noto.py", line 163, in <module>

    merge_fonts(['CJKjp', 'CJKsc'], '/usr/local/share/fonts', '/usr/local/share/fonts')

  File "merge_noto.py", line 147, in merge_fonts

    font = merger.merge(regular_sources)

  File "build/bdist.linux-x86_64/egg/fontTools/merge.py", line 770, in merge

  File "build/bdist.linux-x86_64/egg/fontTools/merge.py", line 150, in merge

  File "build/bdist.linux-x86_64/egg/fontTools/merge.py", line 816, in mergeObjects

  File "build/bdist.linux-x86_64/egg/fontTools/merge.py", line 39, in equal

AssertionError: Expected all items to be equal: [2048, 1000, 1000]



what is the correct way to merge multi noto fonts into one ttf? thanks

Behdad Esfahbod

unread,
Jul 27, 2015, 7:09:22 AM7/27/15
to noto...@googlegroups.com
On 15-07-05 08:30 AM, Wang Dàpéng wrote:
> what is the correct way to merge multi noto fonts into one ttf? thanks

It's not supported right now. But when converting CJK font to TrueType, try
changing EM from 1000 to 2048. That will get you a bit farther.

hanan....@gmail.com

unread,
Dec 21, 2016, 7:52:03 AM12/21/16
to noto-font
Hi,
Did it work? Did you manage to combine the CJK fonts using "merge_noto.py"?

Thanks.

Adam Twardoch

unread,
Dec 21, 2016, 7:31:55 PM12/21/16
to noto-font
It's not really possible to merge the Noto CJK fonts with anything else,
because the Noto CJK fonts have the maximum number of glyphs permissible
in a single OpenType font: 65,635. It's technically impossible to add
any more glyphs to those fonts.

A.
> --
> You received this message because you are subscribed to the Google
> Groups "noto-font" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to noto-font+...@googlegroups.com.
> To post to this group, send email to noto...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/noto-font/2a850bdc-fd6d-4bf1-8472-806ee97c6365%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Naamani

unread,
Dec 22, 2016, 1:17:15 AM12/22/16
to noto-font
On Thursday, December 22, 2016 at 2:31:55 AM UTC+2, Adam Twardoch wrote:
> It's not really possible to merge the Noto CJK fonts with anything else,
> because the Noto CJK fonts have the maximum number of glyphs permissible
> in a single OpenType font: 65,635. It's technically impossible to add
> any more glyphs to those fonts.
>
> A.
>
> On 21 Dec 2016, at 13:52, Naamani wrote:
>
> > On Monday, July 27, 2015 at 2:09:22 PM UTC+3, behdad wrote:
> >> On 15-07-05 08:30 AM, Wang Dàpéng wrote:
> >>> what is the correct way to merge multi noto fonts into one ttf?
> >>> thanks
> >>
> >> It's not supported right now. But when converting CJK font to
> >> TrueType, try
> >> changing EM from 1000 to 2048. That will get you a bit farther.
> >
> > Hi,
> > Did it work? Did you manage to combine the CJK fonts using
> > "merge_noto.py"?
> >
> > Thanks.
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "noto-font" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to noto-font+...@googlegroups.com.
> > To post to this group, send email to noto...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/noto-font/2a850bdc-fd6d-4bf1-8472-806ee97c6365%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

Even in the cost of removing some (or more than some...) of the glyphs? I mean, Ariel Unicode MS does it all, and only in ~23MB. Maybe someone took a different approach with the "merge_noto.py" script - using most of the languages form NOTOSans, and adding the CJK support from different fonts?
The limitation of JAVA-Swing forces us to use a single ttf file. We must support many languages (including CJK), and we really don't want to use Ariel Unicode MS.

jtda...@gmail.com

unread,
Feb 2, 2017, 1:50:58 PM2/2/17
to noto-font, hanan....@gmail.com
I'm wrestling with this problem as well.

My project needs Simplified Chinese but not necessarily Traditional Chinese. I'm betting that would cut way down on the size.

One font file would make my life much simpler.

Hanan Naamani

unread,
Feb 5, 2017, 2:27:04 PM2/5/17
to jtda...@gmail.com, noto-font
The way I was eventually handled this was to merge all of NOTO's languages which I needed, except from the CJK, and add to the created font the CJK support from a different font (in my case, I chose http://nyftp.netbsd.org/pub/pkgsrc/distfiles/cyberbit-ttf/ReadMe.htm).
The merged font did the trick.
Reply all
Reply to author
Forward
0 new messages