12-24-2019, 12:39 AM | #31 |
Connoisseur
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
|
Thanks again! fbink is certainly more robust and powerful.
Wondering about using -pr options to pad text left and right. They don't seem to do anything when used with a font library. I can't use the -c option as there is other stuff elsewhere on the screen. e.g. fbink -t regular=/usr/java/lib/fonts/Caecilia_LT_65_Medium.ttf,px=35,bottom=1410,format "Hello world!" -me if fbink overlays a longer previous text on the same line, bits of it are left after the new line is displayed. I could pad a variable number of blanks on either side of the new text, or write a blank line beforehand, but that seems tedious - is there an easier way to have fbink pad out blanks left and right of the text when using a tt font? I am trying to keep screen writing as simple as possible to maxamize battery life. Last edited by handyguy; 12-24-2019 at 12:42 AM. |
12-24-2019, 09:19 AM | #32 |
BLAM!
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
The OpenType codepath handles positioning completely differently than the fixed cell codepath (margins in pixels, instead of row/col +/- pixels).
As such, some of the more esoteric features available w/ cell rendering aren't supported. Padding (left or right) happens to be one of those things . (The API documentation for print_ot should have the exact list of supported settings. The CLI tool's help message has a matching "Honor <such and such> flags" line, too). Font metrics and weird (and not so weird) corner-cass being what they are, what you're asking for is actually slightly tricky to reliably compute *without* rendering the line first. Especially with non-monospaced fonts . (Conversely, it's fairly trivial with fixed-cell, because we know the absolute amount of cells in a line, and that every glyph will fit in one, and that every cell will have the same size). Depending on what exactly you're doing, the easiest workarounds would be adding a few blank spaces on the edges and/or playing with the margins. (i.e., unless you're in backgroundless mode, the full drawing area will be background-colored, preventing overlaps if you're reusing the same margins (EDIT: Nope, that was a lie ^^)). You can probably fine-tune the amount of padding needed via the "compute" feature, which will report the amount of lines that would have been printed, and whether it had to be truncated. While the --coordinates flag will report the actual bounding box of the whole thing. Last edited by NiLuJe; 12-24-2019 at 11:11 AM. |
Advert | |
|
12-24-2019, 09:27 AM | #33 |
BLAM!
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
That said, see my latest edits, re-using the same margins should ensure no overlaps, *unless* you're in backgroundless mode. (EDIT: Or not . See next post).
So, I'm probably going to need a bit more context if that doesn't help . Last edited by NiLuJe; 12-24-2019 at 11:12 AM. |
12-24-2019, 09:37 AM | #34 |
BLAM!
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Oh. Except what we ultimately blit to screen is limited to actually useful content, so the edges of the drawing area are left alone.
I guess I could make the "background" content between the text and the edges of the drawing area be rendered for the amount of effectively printed lines. Holiday season being what it is, I won't have time to look into this for a few days, though . (Even this is written in a rush, I may be misremembering how all of this works internally ^^). Last edited by NiLuJe; 12-24-2019 at 11:12 AM. |
12-24-2019, 11:09 AM | #35 |
BLAM!
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Yeah, after a quick look at the code on mobile, I can probably cobble something up when I get back home .
|
Advert | |
|
12-26-2019, 03:00 PM | #36 |
BLAM!
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Okay, master now has a few extra padding settings (via a new padding suboption) when rendering OT/TTF fonts .
Last edited by NiLuJe; 12-27-2019 at 09:48 AM. |
12-28-2019, 06:24 PM | #37 |
Connoisseur
Posts: 70
Karma: 11789
Join Date: Dec 2019
Device: PW4
|
cool! thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
K4 and Touch framebuffer changes | geekmaster | Kindle Developer's Corner | 13 | 05-19-2014 08:08 PM |
e-ink/reader framebuffer device (killed it, sorta) | tarvoke | enTourage eDGe | 26 | 01-08-2012 04:58 AM |
Kindle Qt embedded framebuffer driver | hassan | Kindle Developer's Corner | 2 | 08-20-2011 10:31 PM |
Nook eInk getting a "major update" (v1.5) update next week | =X= | News | 3 | 11-16-2010 12:54 PM |