This is regarding:
[B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View
https://www.b4x.com/android/forum/t...t-engine-bbcode-parser-rich-text-view.106207/
Examples showing bad kerning, taken from that thread:
I am very fond of BCTextEngine / BBCodeView, but I'm finding it very difficult to use it due to the lack of kerning, which makes the text look inferior to other text we have in our devices. So my wish is to add kerning to BCTextEngine / BBCodeView.
A thought about a potential solution
I have full respect for this potentially being a complex thing to add (working with typography and fonts can be quite mind-melting). My naïve view of this is that currently each character is rendered in a buffer, measured using a bounding box and then placed onto the resulting image. (I really don't know if this is how it's done, it's just my best guess, but I'll go ahead and assume it's not completely wrong.) This works fine to get a character shape, but it doesn't take the actual kerning tables (that are built into the font itself) into account. To my knowledge there is no way to directly access the values in those tables unless you use a font editor, which we don't want to do. However, if we instead would render a whole word off-screen, that would automatically (I think) use the kerning tables. This word could then be measured using the bounding box and be placed onto the resulting image. We would get small inconsistencies with how the characters connect to the surrounding spaces and delimiters, but that should be a lot less noticable. I'm not sure if this helps or not, but I thought it couldn't hurt to mention it - if it works it might make for a solution that doesn't involve soul-crushing pain.
(For the people unsure what kerning is, I recommend reading Learning the basics of kerning and perhaps the Wikipedia page about Kerning. Here is an image from the first link to illustrate
I'm also aware that some people really just can't see problematic or missing kerning very well. That's fine, but some of us are very aware of it, and find bad/missing kerning very painful on the eye.)
[B4X] BCTextEngine / BBCodeView - Text engine + BBCode parser + Rich Text View
https://www.b4x.com/android/forum/t...t-engine-bbcode-parser-rich-text-view.106207/
With BBCodeView, text is the king.
Kerning is currently not supported.
Examples showing bad kerning, taken from that thread:
I am very fond of BCTextEngine / BBCodeView, but I'm finding it very difficult to use it due to the lack of kerning, which makes the text look inferior to other text we have in our devices. So my wish is to add kerning to BCTextEngine / BBCodeView.
A thought about a potential solution
I have full respect for this potentially being a complex thing to add (working with typography and fonts can be quite mind-melting). My naïve view of this is that currently each character is rendered in a buffer, measured using a bounding box and then placed onto the resulting image. (I really don't know if this is how it's done, it's just my best guess, but I'll go ahead and assume it's not completely wrong.) This works fine to get a character shape, but it doesn't take the actual kerning tables (that are built into the font itself) into account. To my knowledge there is no way to directly access the values in those tables unless you use a font editor, which we don't want to do. However, if we instead would render a whole word off-screen, that would automatically (I think) use the kerning tables. This word could then be measured using the bounding box and be placed onto the resulting image. We would get small inconsistencies with how the characters connect to the surrounding spaces and delimiters, but that should be a lot less noticable. I'm not sure if this helps or not, but I thought it couldn't hurt to mention it - if it works it might make for a solution that doesn't involve soul-crushing pain.
(For the people unsure what kerning is, I recommend reading Learning the basics of kerning and perhaps the Wikipedia page about Kerning. Here is an image from the first link to illustrate
I'm also aware that some people really just can't see problematic or missing kerning very well. That's fine, but some of us are very aware of it, and find bad/missing kerning very painful on the eye.)