![]() |
#121 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
Hi
Just a couple of notes for those using the new OpenType/TrueType functionality, as there are some differences compared to the traditional FBInk printing methods. Unicode linebreaking is used for wrapping lines. This means, that when printing OT/TT, the line will try to avoid breaking mid-word. OT support uses margins, instead of cells, for positioning. That means you can set a printable area with top, bottom, left and right margins. The margins are specified in pixels, so at the moment API users may want to use the fbink_get_state() function to get the current screen resolution. You can also align text WITHIN the printable area defined by the margins. This allows for both horizontal and vertical alignment. With the combination of alignment and margins, some creative positioning can be obtained... Bold and Italics support is enabled via a simple markdown syntax (eg *italic*, **bold**, ***bold italic***). This is a very simplistic parser, so I would advise doing anything to complicated with it. EDIT: and it will abort if you don't have the appropriate bold and/or italic font loaded, so beware! Other than that, have fun! Huge thanks to NiLuJe for letting me play in the FBInk sandbox, and for graciously polishing my code. (Also, if NiLuJe ever offers you a copy of Bookerly, run far far away. It is an evil version of the font, which made my code blow up...) Last edited by sherman; 11-02-2018 at 04:43 PM. |
![]() |
![]() |
![]() |
#122 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Just my luck that the second font I'd try would blow up in fun and interesting ways
![]() |
![]() |
![]() |
Advert | |
|
![]() |
#123 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
|
![]() |
![]() |
![]() |
#124 |
Member
![]() Posts: 12
Karma: 10
Join Date: Aug 2018
Device: kobo aura edition 2
|
hi folks, could you post simple working OT/TT command?ı'm so idiot and cannot run the OT/TT examples on the fbink 1.8 manual page.
By the way sorry for my fcking freaking bad english. |
![]() |
![]() |
![]() |
#125 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
@codex-hex see in the FUNtastic spoiler 2 posts above.
|
![]() |
![]() |
Advert | |
|
![]() |
#126 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
The example is using custom fonts, with a fixed Kobo path. In hindsight, that was probably not a fantastic idea
![]() EDIT: On Kindle, using this instead should actually do something: Code:
fbink -t regular=/usr/java/lib/fonts/Caecilia_LT_65_Medium.ttf,bold=/usr/java/lib/fonts/Caecilia_LT_75_Bold.ttf,size=24,top=100,bottom=500,left=25,right=50,format "Hello **world**!" Last edited by NiLuJe; 11-03-2018 at 03:16 PM. |
![]() |
![]() |
![]() |
#127 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
What am I missing?
I am trying Code:
fd=/mnt/us/fonts/ fbink -c -t regular="$fd"unscii-8.otf,size=60 -m -M " " #\uEC2B \uEC2D \uEC2E \uEC2F \uEC30 \uEC31 \uEC32 \uEC35 \uEC36 fbink prints the 9 characters: Code:
[root@kindle us]# fd=/mnt/us/fonts/ [root@kindle us]# fbink -c -t regular="$fd"unscii-8.otf,size=60 -m -M "? ? ? ? ? ? ? ? ?" [FBInk] Clock tick frequency appears to be 100 Hz [FBInk] Screen density set to 300 dpi [FBInk] Variable fb info: 1072x1448, 8bpp @ rotation: 3 (Counter Clockwise, 270°) [FBInk] Fontsize set to 32x32 (IBM base glyph size: 8x8) [FBInk] Line length: 33 cols, Page size: 45 rows [FBInk] Vertical fit isn't perfect, shifting rows down by 4 pixels [FBInk] Fixed fb info: ID is "mxc_epdc_fb", length of fb mem: 6782976 bytes & line length: 1088 bytes [FBInk] Pen colors set to #000000 for the foreground and #FFFFFF for the background Loading font '/mnt/us/fonts/unscii-8.otf' for the Regular style [FBInk] Font '/mnt/us/fonts/unscii-8.otf' loaded Printing string ' ' @ 60pt, honoring the following margins { top: 0px, bottom: 0px, left: 0px, right: 0px } (formatted: false, overlay: false, backgroundless: false, foregroundless: false, inverted: false, flashing: false, centered: true, halign: 0, halfway: true, valign: 0, clear screen: true) [root@kindle us]# |
![]() |
![]() |
![]() |
#128 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@PoP: That's probably #21
![]() Will be fixed in the next release ![]() (For now, you can add bogus padding characters at the end of your string to get stuff to show up). |
![]() |
![]() |
![]() |
#129 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
^ Yep
Code:
fdsys=/usr/java/lib/fonts/ #Qapla' fbink -c -t regular="$fdsys"code2000.ttf,size=60 -m -M " " screenshot ![]() |
![]() |
![]() |
![]() |
#130 |
Member
![]() Posts: 12
Karma: 10
Join Date: Aug 2018
Device: kobo aura edition 2
|
Please help me to show on my kobo
İ need simple universal command to show OT/TT fonts. İ must know What i am missing. Your funtastic script parts doesnt show anything on my screen and fbink doesnt give me any error message interestingly. |
![]() |
![]() |
![]() |
#131 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
@codex-hex
The example you refer to reads Code:
fbink -t regular=/mnt/onboard/fonts/NotoSans-Regular.ttf,bold=/mnt/onboard/fonts/NotoSans-Bold.ttf,size=24,top=100,bottom=500,left=25,right=50,format "Hello **world**!"
Will use NotoSans to print 'Hello world!' at 24pt in a display area starting from 100px down the top of the screen to 500px before the bottom of the screen,
from 25px of the left edge of the screen until 50px before the right edge.
Honoring the MarkDown syntax, 'Hello' will be printed with the Regular font style, while 'world' will use the Bold font style.
Can you verify this on your device. Otherwise, if the font files are located in another path, change the command to use that one. Please post the session log if that still doesn't work. |
![]() |
![]() |
![]() |
#132 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@codex-hex: what PoP said, plus your exact device and FW version, and the full fbink output (with the -v flag).
The paths on Kobo should be something like... Code:
fbink -t regular=/usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Caecilia.ttf,bold=/usr/local/Trolltech/QtEmbedded-4.6.2-arm/lib/fonts/Caecilia-Bold.ttf,size=24,top=100,bottom=500,left=25,right=50,format "Hello **world**!" ![]() EDIT²: Because they're encrypted or obfuscated or something. Yaaaaaay. -_-". TL;DR: Can't use system fonts on Kobo! Last edited by NiLuJe; 11-04-2018 at 01:44 PM. |
![]() |
![]() |
![]() |
#133 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Released v1.8.1!
Mainly bugfixes, among which the UTF-8 issue discussed above ![]() The OT/TTF renderer now also honors AA when using bgless/fgless/overlay rendering mode (... even on 4bpp devices, which I hate with a renewed fiery passion. I nearly threw the K3 out the window ![]() It also fixes a regression in the fixed-cell font rendering, which happened to choose a smaller scaling multiplier than it should have on devices with a non-HD screen... Last edited by NiLuJe; 11-04-2018 at 06:45 PM. |
![]() |
![]() |
![]() |
#134 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
|
![]() |
![]() |
![]() |
#135 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
Remember? Now revived on my K3! (Which *will* be a great loss when it dies ![]() Last edited by PoP; 11-04-2018 at 09:13 PM. |
|
![]() |
![]() |
![]() |
Tags |
eips, fbink |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
FBInk: A small tool/library to print crap on your screen! | NiLuJe | Kobo Developer's Corner | 311 | 06-20-2025 01:19 PM |
Small print | Broadback | Conversion | 12 | 12-12-2011 02:31 PM |
Small Tool to change book order (PRS-x50) | goaspy | Sony Reader | 113 | 10-14-2011 03:28 PM |
small print | breezeman | Introduce Yourself | 13 | 07-03-2011 09:02 AM |