New issue

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

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

Already on GitHub? Sign in to your account

cre: configurable kerning method (off/freetype/harfbuzz) #4167

Merged
merged 3 commits into from Aug 17, 2018

Conversation

Projects
None yet
5 participants
@poire-z
Contributor

poire-z commented Aug 17, 2018

Will need bumps for koreader/koreader-base#720 and koreader/crengine#228.
Details about harfbuzz rendering in koreader/crengine#224.

image

image

As it looks like harfbuzz does a little more than just kerning (ligature, individual RTL words ordering), we may call that toggle something else, like Font Shaping ? (although I just discovered that term a week ago :) so Shaping may speak even less than Kerning...)
And freetype|harfbuzz rename to fast|enhanced if we don't want to expose the involved technical engines names?

image

@KenMaltby

This comment has been minimized.

KenMaltby commented Aug 17, 2018

This may be too far into the weeds for many readers, but a long press description added to; "Font Kerning" and "Font Shaping" might allow for more users giving them a try. I thought I had a reasonable vocabulary, but "harfbuzz"? One "rule" that might be useful, is if some term sets off the spellchecker it probably needs some explanation. (I realize it is easy for me to point this out, and kind of lame for me not to be providing such text, but I haven't a clue.)

@poire-z

This comment has been minimized.

Contributor

poire-z commented Aug 17, 2018

I added some help text:

image

But ok, I guess we'll go with fast and enhanced then :) and just mention FreeType and HarfBuzz in this help_text.

(But what?! You didn't know "HarfBuzz" is the Persian for "open type" ?! :) https://harfbuzz.github.io/why-is-it-called-harfbuzz.html )

@Frenzie

This comment has been minimized.

Member

Frenzie commented Aug 17, 2018

I mainly know because I looked up some stuff about how one would do RTL properly, with Unicode diacritics.

For us Westerners, all that we really want from Harfbuzz is nicer kerning.

help_text = _([[Font kerning is the process of adjusting the spacing between individual letter forms, to achieve a visually pleasing result.
- off: no kerning.
- freetype: use FreeType's kerning implementation (no ligature).

This comment has been minimized.

@Frenzie

Frenzie Aug 17, 2018

Member

no ligatures

- off: no kerning.
- freetype: use FreeType's kerning implementation (no ligature).
- harfbuzz: use Harfbuzz's kerning implementationg (slower but may support ligatures with some fonts).]]),

This comment has been minimized.

@Frenzie

Frenzie Aug 17, 2018

Member

We should probably mention something about RTL here as well (Hebrew, Arabic, Persian, etc.)

This comment has been minimized.

@poire-z

poire-z Aug 17, 2018

Contributor

But it doesn't magically make RTL work ! :) It's really incomplete. I mean like:
tuB ti t'nseod yllacigim ekam LTR krow ! ): tI's yllaer etelpmocni. ylleaR!

Or rather, it would help reading words, but the words themselves would be still LTR, like:
like:, LTR still be would themselves words the but, words reading help would it, rather Or.

This comment has been minimized.

@Frenzie

Frenzie Aug 17, 2018

Member

True, but without Harfbuzz things like RTL Unicode combining diacritics "should" attach to the wrong characters and the like.

Just flipping word order sounds like a fairly simple proposition in theory. All that proper Unicode handling — nope, we'd better let some Persian deal with that! ;-)

This comment has been minimized.

@poire-z

poire-z Aug 17, 2018

Contributor

Flipping word order sounds simple indeed. But then, there's all the crengine mapping to the DOM text nodes that fails (finding word boundaries for highlight, searching, clicking on links...) So there's quite a bit of thinking on that side to do.
Which could be interesting. But when you don't read any RTL language, it's some blind fun... :)

@poire-z

This comment has been minimized.

Contributor

poire-z commented Aug 17, 2018

@Frenzie : any preference between the ui elements naming: Font Kerning / Font Spacing , freetype|harfbuzz vs fast|enhanced (or else?)

@NiLuJe

This comment has been minimized.

Member

NiLuJe commented Aug 17, 2018

IIRC, I've sometimes seen that kind of toggle behind something like "Font Shaping: Simple/Complex".

@Frenzie

This comment has been minimized.

Member

Frenzie commented Aug 17, 2018

Definitely kerning. Spacing is something else.

fast/enhanced sounds pretty good, or maybe something involving quality?
fast/best
fast/high

(Just some brainstorm.)

@poire-z

This comment has been minimized.

Contributor

poire-z commented Aug 17, 2018

I wrote Spacing but I meant Font shaping, as that's what HarfBuzz calls itself.
(Screenshot and argument in top post).

@Frenzie

This comment has been minimized.

Member

Frenzie commented Aug 17, 2018

Kerning is slightly jargon, but everybody who knows a tiny bit about typography should probably know it and it should have readily available Wikipedia/encyclopedia/dictionary lemmas.

Shaping… that seems very Harfbuzz specific. You can try to prove me wrong, but I don't think I've ever seen it in any typography books. ;-)

@poire-z

This comment has been minimized.

Contributor

poire-z commented Aug 17, 2018

OK, so let's stay with Font Kerning and go with fast (clearer why you want to use that than simple) and enhanced (I like it better than best, high, complex, thus a bit longer):

image
(there might be a slight centering issue of text in their toggle, see enhanced)

image

@poire-z poire-z merged commit 6f2368e into koreader:master Aug 17, 2018

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@poire-z poire-z deleted the poire-z:configurable_kerning branch Aug 17, 2018

@CalbertAmu

This comment has been minimized.

CalbertAmu commented Aug 17, 2018

Kerning and Ligatures are the only things I've missed on KOReader. I am very excited for this. I'm not familiar with how GitHub works. Will this be implemented into the next update?

@NiLuJe

This comment has been minimized.

Member

NiLuJe commented Aug 17, 2018

It'll make it first into the next nightly OTA (which should hit the OTA servers at around 5AM UTC (i.e., 5 hours from now)).

@Frenzie

This comment has been minimized.

Member

Frenzie commented Aug 18, 2018

@CalbertAmu GitHub is just a source code repository; by itself it doesn't do anything. But we have an automated chain of events setup that builds the source code from GitHub into functioning packages every night.

For regular use it's recommended to just stick to the releases on GitHub or http://build.koreader.rocks/download/nightly/ But the curious can find cach and every one can be found here: https://gitlab.com/koreader/nightly-builds/pipelines

Incidentally, @NiLuJe I just noticed the Ubuntu Touch build has been failing recently, presumably since some changes of yours. ;-)

If it becomes too much effort to maintain we should deprecate it, but could you take a quick look at the logs please?

@NiLuJe

This comment has been minimized.

Member

NiLuJe commented Aug 18, 2018

@Frenzie : Yup, that's the jpeg-turbo bump :D.

Is that target supposed to be x86_64 or x86?

EDIT: Ah, it's supposed to be ARM, which would certainly explain why it doesn't like x86 assembly :D.

@Frenzie

This comment has been minimized.

Member

Frenzie commented Aug 18, 2018

Yup, ARM for phones and tablets. Ubuntu Touch, Sailfish OS, Windows Phone... all much better than Android imo. Oh well, Sailfish is still going strong!

@NiLuJe

This comment has been minimized.

Member

NiLuJe commented Aug 18, 2018

Will bundle a fix (hopefully...) in the OpenSSL PR ;).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment