Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't get ligatures to work. #19

Closed
casperno opened this issue May 11, 2016 · 4 comments
Closed

Can't get ligatures to work. #19

casperno opened this issue May 11, 2016 · 4 comments

Comments

@casperno
Copy link

Testing with

new Text({
            text: 'Love me some ft ff f t ff poiretone fi ',
            font: 'sourcesanspro',
            align: Align.TOP_LEFT,
            width: 400,
            height: 400,
            tracking: 150,
            ligatures: true,
            size: 60,
            x: 10,
            y: 20,
            debug: false
        })

source sans pro has ft and ff ligatures, but they don't seem to work with this example.

The font in the samle (http://txtjs.com/examples/Text/ligatures.html) doesn't seem to have ligatures at all.

@casperno
Copy link
Author

Looked at it some more. From the code, I see that tracking != 0 will turn ligatures off. I tried that, but still no go.

Then I debugged and found that the "source sans pro" version provided with the project doesn't seem to have ligatures.

Actually, if I'm interpreting the font.txt format correctly none of the fonts have ligatures. Ligatures would be at the end of the filed, preceded by '3', right?

@diverted247
Copy link
Owner

It depends if the characters are exported. Ligatures bloat the font about 3x in some cases so we defaulted to not exporting them. It add them, export the font with /tools/font export/Characters.py uncomment the ligatures you want added. Once the txt font contains then, they will work.

Get Outlook for iOS

On Wed, May 11, 2016 at 10:55 PM -0700, "casperno" notifications@github.com wrote:

Looked at it some more. From the code, I see that tracking != 0 will turn ligatures off. I tried that, but still no go.

Then I debugged and found that the "source sans pro" version provided with the project doesn't seem to have ligatures.

Actually, if I'm interpreting the font.txt format correctly none of the fonts have ligatures. Ligatures would be at the end of the filed, preceded by '3', right?


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub

@casperno
Copy link
Author

Got it.

Only real issue remaining is that the ligature example (http://txtjs.com/examples/Text/ligatures.html) doesn't have ligatures.

So when you created all the font.txt files this repo, you left ligatures commented out?

I'm a bit unsure to how ligatures can triple the font size — usually there's just a handful of them. Or maybe 'ligatures' cover more glyphs than the traditional "fi" etc. I associate them with.

@diverted247
Copy link
Owner

Ah... I updated the export a while back and must have exported without ligatures. The file size factor depends on the source font, some contain hundreds of ligatures and sometimes many duplicates where style was slightly different. Then again we were dealing with fonts for print design so that made the issue worse. Exported font for Bickham Script with ligatures was 370kb, ligatures removed 120kb

Get Outlook for iOS

_____________________________

From: casperno notifications@github.com
Sent: Thursday, May 12, 2016 6:05 AM
Subject: Re: [diverted247/txtjs] Can't get ligatures to work. (#19)
To: diverted247/txtjs txtjs@noreply.github.com
Cc: Comment comment@noreply.github.com, Ted Patrick ted@tedpatrick.com

Got it.

Only real issue remaining is that the ligature example (http://txtjs.com/examples/Text/ligatures.html) doesn't have ligatures.

So when you created all the font.txt files this repo, you left ligatures commented out?

I'm a bit unsure to how ligatures can triple the font size — usually there's just a handful of them. Or maybe 'ligatures' cover more glyphs than the traditional "fi" etc. I associate them with.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants