Re: How to generate fonts

Posted by mojavelinux on
URL: https://discuss.asciidoctor.org/How-to-generate-fonts-tp2358p2360.html

I'll follow up with some detail as soon as I get a chance.

Until then, I highly recommend the following two (free) resources.

Scripting tutorial:: http://fontforge.org/scripting-tutorial.html
FontForge book:: http://designwithfontforge.com/en-US/index.html

That's how I learned enough to create the existing script.

As a quick hint, you'll want to select all the characters using something like:

SelectMore(0u0020,0u1eff)

But I recommend reading through at least the scripting tutorial. At first, it's pretty dense, but once you get a handle on a few concepts, you'll find tremendous power in being able to work with fonts, including merging and remapping them :)

Cheers,

-Dan


On Mon, Oct 20, 2014 at 11:52 PM, chloerei [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I'm using asciidoctor-pdf, and I want to render a document write in CJK charsets, so I need to add a CJK font in theme.

I have read https://github.com/asciidoctor/asciidoctor-epub3/blob/master/scripts/generate-font-subsets.pe , it looks complex than I think.

I don't need subsets, so I use this script to covert Noto CJK font from OTF to TTF:

[source]
----
#!/usr/bin/env fontforge
Open($1)
Generate($1:r + ".ttf")
----

But it drops the CJK, how to convert all fonts?

And I found I must convert four styles(normal, bold, italic, bold_italic) for each fonts. Could you release a more simple script to convert a font to four styles without subsets? It works like:

[source]
----
$ generate-font NotoSansCJKsc-Regular.otf
Genrating...
NotoSansCJKsc-Regular-Regular.ttf
NotoSansCJKsc-Regular-Bold.ttf
NotoSansCJKsc-Regular-Italic.ttf
NotoSansCJKsc-Regular-BoldItalic.ttf
----

This example look duplicate with regular and bold, because Noto CJK has release different weight, but it's useful for some font only have one weight(like DroidFallback).

I don't konw font format's detail, so I probably misunderstood, it it possible?


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-to-generate-fonts-tp2358.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | http://google.com/profiles/dan.j.allen