Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-12-2018, 07:35 PM   #166
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
[EDIT]
One more to go: Oh no, it is at a different codepoint!

Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/poplarstd.otf,size=100 "1234567" -M -m -c
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/poplarstd.otf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/poplarstd.otf' loaded
Printing string '1234567' @ 100pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: N, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	7.png
Views:	206
Size:	5.4 KB
ID:	167667good color, 7 in expected location.

[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/poplarstd.otf,size=100 "i" -M -m -c
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/poplarstd.otf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/poplarstd.otf' loaded
Printing string 'i' @ 100pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: N, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	i.png
Views:	167
Size:	683 Bytes
ID:	167668doesn't seg fault anymore
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/unscii-8.otf,size=86 -o -M -m -c -v < u1F680
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/unscii-8.otf' for the Regular style
Initialized libunibreak
[FBInk] Font '/mnt/us/linkfonts/fonts/unscii-8.otf' loaded
Printing OpenType text.
Unformatted text defaulting to Regular font style
Max BL: 199  Max Desc: 0  Max LG: 24
Finished looking for linebreaks
Current Measured LW: 114  Line# 0
Current Measured LW: 239  Line# 0
1 lines to be printed
Maximum printable height is 800
Actual print height is 199
Max LW: 600  Max LH: 199  Max BL: 199  FntSize: 199
Snipped Line# 0 LW down to 238
Finished printing line# 0
Refreshing region from LEFT: 180, TOP: 300, WIDTH: 239, HEIGHT: 199
Area is: x1: 0, y1: 0, x2: 600, y2: 800 with fx: 0
Detected a full-screen area, upgrading to FBIO_EINK_UPDATE_DISPLAY
[root@kindle us]# ./screenshot
Click image for larger version

Name:	u+1F860.png
Views:	201
Size:	627 Bytes
ID:	167669still no cigar, 
Click image for larger version

Name:	FontForge u+1F860.png
Views:	221
Size:	34.8 KB
ID:	167670even though it is there
[EDIT²] still no cigar after correction!?
Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/unscii-8.otf,size=86 -o -M -m -c -v < u1F860
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/unscii-8.otf' for the Regular style
Initialized libunibreak
[FBInk] Font '/mnt/us/linkfonts/fonts/unscii-8.otf' loaded
Printing OpenType text.
Unformatted text defaulting to Regular font style
Max BL: 199  Max Desc: 0  Max LG: 24
Finished looking for linebreaks
Current Measured LW: 114  Line# 0
Current Measured LW: 239  Line# 0
1 lines to be printed
Maximum printable height is 800
Actual print height is 199
Max LW: 600  Max LH: 199  Max BL: 199  FntSize: 199
Snipped Line# 0 LW down to 238
Finished printing line# 0
Refreshing region from LEFT: 180, TOP: 300, WIDTH: 239, HEIGHT: 199
Area is: x1: 0, y1: 0, x2: 600, y2: 800 with fx: 0
Detected a full-screen area, upgrading to FBIO_EINK_UPDATE_DISPLAY
Click image for larger version

Name:	u1F860.png
Views:	170
Size:	627 Bytes
ID:	167672after code point corrected

[EDIT³] @NiLuJe below. OK let me sleep on this, my brain is misfiring.

[EDIT⁴] Ah, precombined = f09fa1a0, UTF-8 in hex. Got it. Case closed.

[EDIT⁵] Click image for larger version

Name:	flying.png
Views:	182
Size:	653 Bytes
ID:	167673proof
Attached Files
File Type: zip u1F860.zip (154 Bytes, 171 views)

Last edited by PoP; 11-12-2018 at 08:28 PM.
PoP is offline   Reply With Quote
Old 11-12-2018, 07:52 PM   #167
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@PoP: Use precombined characters, we don't do any shaping/normalization, so any funky multi-code character will probably not do what you want, and will instead print those multiple codepoints separately (which is why you get two fallback characters here ).

(In this case, I simply had to c/p the rocket from your original post, as rendered by firefox, and voilà).

EDIT: Speaking of ZSH, its echo builtin should handle Unicode escapes: echo "\U1F680" does the right thing on my end .

Last edited by NiLuJe; 11-12-2018 at 09:35 PM.
NiLuJe is offline   Reply With Quote
Old 11-14-2018, 01:36 PM   #168
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
@PoP: Go forth, and break stuff! ;p.
Trying.

Quote:
Originally Posted by NiLuJe View Post
@PoP: Use precombined characters, we don't do any shaping/normalization, so any funky multi-code character will probably not do what you want, and will instead print those multiple codepoints separately...
Funky Diacritical combining marks can't break it:

Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf,size=58 -o -M -m -c "curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨʎʌɹnɔ" #curly\u1DC2\u0353\u032B\u0319\u1DCA\u0325\u032E\u033E\u036F\u0364\u036D\u036C\u0366\u0368\u028E\u028C\u0279n\u0254
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' loaded
Printing string 'curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨʎʌɹnɔ' @ 58pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: Y, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	curlycurvy.png
Views:	181
Size:	4.2 KB
ID:	167694 Ok, they don't stack up (like it shows if you quote this post) but I didn't expect them to work at all.

And

[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf,size=58 -o -M -m -c "É vs É" # E\u0301 vs \u00C9
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' loaded
Printing string 'É vs É' @ 58pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: Y, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	É.png
Views:	205
Size:	2.4 KB
ID:	167695 isn't bad either.
PoP is offline   Reply With Quote
Old 11-14-2018, 01:43 PM   #169
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Eh, that's honestly better than I'd have expected .
NiLuJe is offline   Reply With Quote
Old 11-17-2018, 01:57 PM   #170
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by NiLuJe View Post
@PoP: Go forth, and break stuff! ;p.
At it again Some characters present in the font are printed as a boxed question mark.

Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf,size=36 -o -M -m -c "U+13B7 Ꮇ
> U+FF2D M
> U+3289 ㊉" 
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' loaded
Printing string 'U+13B7 Ꮇ
U+FF2D M
U+3289 ㊉' @ 36pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: Y, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y)
[root@kindle us]#screenshot
Click image for larger version

Name:	20181117143826.png
Views:	163
Size:	4.8 KB
ID:	167773
Rendered with Symbola.ttf in Winword:

Click image for larger version

Name:	symbola in Word.png
Views:	202
Size:	53.7 KB
ID:	167774
PoP is offline   Reply With Quote
Old 11-17-2018, 05:21 PM   #171
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@PoP: Well, that was easy: they're really not in the font, so I suspect Word is pulling them from somewhere else (probably Segoe UI Symbols) .
NiLuJe is offline   Reply With Quote
Old 11-17-2018, 08:53 PM   #172
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
^ not in the font, precisely . Sorry ...winword ...sigh.

[EDIT 2018-11-18]

Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/code2000.ttf,size=36 -o -M -m -c "U+13B7 Ꮇ
> U+FF2D M
> U+3289 ㊉"
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/code2000.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/code2000.ttf' loaded
Printing string 'U+13B7 Ꮇ
U+FF2D M
U+3289 ㊉' @ 36pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: Y, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	20181118091225.png
Views:	171
Size:	5.3 KB
ID:	167800  with trusty code2000
[EDIT 2018-11-19] At least I learned about Microsoft's uniscribe font fallback!

Last edited by PoP; 11-19-2018 at 03:42 PM.
PoP is offline   Reply With Quote
Old 11-22-2018, 01:00 AM   #173
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Of potential interest to people with a strong aversion to C, or for whatever reason (prototyping?), I've whipped up basic FFI bindings for LuaJIT & Python .

The Python bindings are bundled in my usual Python package .

The full list of available bindings is in the README. Right now, that's @sherman's Go bindings and those two .
NiLuJe is offline   Reply With Quote
Old 11-22-2018, 04:52 PM   #174
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Released v1.9.2!

Mainly a bunch of bugfixes around OpenType/TrueType rendering, as well as adding the ability to inhibit eInk refreshes, in case you want to do a bunch of things in quick succession.
Oh, and support for negative margins in OT/TTF rendering to make it easier to align stuff to the bottom/right edges .

As mentioned earlier, this also introduces Python & Lua bindings, for when shell scripting can't quite cut it anymore . And, in the spirit of helping people to avoid having to set-up a cross-compilation toolchain, here's a LuaJIT binary .
Attached Files
File Type: gz LuaJIT-v2.1-kindle.tar.gz (1.16 MB, 73 views)

Last edited by NiLuJe; 01-29-2021 at 07:56 PM. Reason: Refresh binaries
NiLuJe is offline   Reply With Quote
Old 11-25-2018, 08:30 PM   #175
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
I wanted to center a tall integral on the screen an another funky character pleasantly surprised me

First I used LF
Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf,size=72 -M -m -c "⌠
> ⎮
> ⌡"  #Tall integral with line feeds U+0A
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' loaded
Printing string '⌠
⎮
⌡' @ 72pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: N, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y, skip refresh: N)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	LF0A.png
Views:	162
Size:	1.7 KB
ID:	168012 is centered and halfway as expected
Then I used LS, and was surprised that it also worked!
Code:
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf,size=72 -M -m -c "⌠
> ⎮
> ⌡"  #Tall integral with line separators U+2028
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' loaded
Printing string '⌠
⎮
⌡' @ 72pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: N, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y, skip refresh: N)
[root@kindle us]# ./screenshot
Click image for larger version

Name:	LS2320.png
Views:	165
Size:	1.7 KB
ID:	168013 remarkably, is also centered and halfway

Last edited by PoP; 11-28-2018 at 10:58 AM. Reason: U+ typo
PoP is offline   Reply With Quote
Old 11-25-2018, 09:17 PM   #176
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Yeah, the OTF/TTF path outsources linebreaking to a library which implements the Unicode line breaking algorithm (UAX #14).

I'm glad to see it works!
sherman is offline   Reply With Quote
Old 12-09-2018, 04:06 PM   #177
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 3,002
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
Quote:
Originally Posted by sherman View Post
Yeah, the OTF/TTF path outsources linebreaking to a library which implements the Unicode line breaking algorithm (UAX #14).

I'm glad to see it works!
Probably out of scope here, and no big deal:

Reading the #14 annex I think that U+00AD (SHY), funky Soft Hyphens, should only be rendered at line break versus U+2010 Hyphens which should always be visible.

Code:
Using username "root".
[root@kindle us]# fbink -t regular=/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf,size=72 -M -m -c "S*O*F*T
> vs
> H‐A‐R‐D" # where "*" are U+00AD "-" are U+2010 
[FBInk] Enabled Legacy einkfb Kindle quirks
[FBInk] Clock tick frequency appears to be 100 Hz
[FBInk] Screen density set to 167 dpi
[FBInk] Variable fb info: 600x800, 4bpp @ rotation: 0 (Upright, 0°)
[FBInk] Fontsize set to 16x16 (IBM base glyph size: 8x8)
[FBInk] Line length: 37 cols, Page size: 50 rows
[FBInk] Fixed fb info: ID is "eink_fb", length of fb mem: 483328 bytes & line length: 300 bytes
[FBInk] Pen colors set to #000000 -> #FFFFFF for the foreground and #FFFFFF -> #000000 for the background
Loading font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' for the Regular style
[FBInk] Font '/mnt/us/linkfonts/fonts/Symbola_Hinted.ttf' loaded
Printing string 'S*O*F*T
vs
H‐A‐R‐D' @ 72pt, honoring the following margins { Top: 0px, Bottom: 0px, Left: 0px, Right: 0px } (formatted: N, overlay: N, no BG: N, no FG: N, inverted: N, flashing: N, centered: Y, H align: 0, halfway: Y, V align: 0, clear screen: Y, skip refresh: N)
[root@kindle us]# ,/screenshot
-sh: ,/screenshot: not found
[root@kindle us]# ./screenshot
Click image for larger version

Name:	SOFTvsHARD.png
Views:	192
Size:	6.3 KB
ID:	168254 was expecting SOFT vs H-A-R-D
[root@kindle us]#

Last edited by PoP; 12-09-2018 at 04:10 PM.
PoP is offline   Reply With Quote
Old 12-09-2018, 04:20 PM   #178
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@PoP: No layout engine, so if there's space to print it, it'll get printed .

I'd imagine libunibreak will of course use those as viable break points, but that's irrelevant when there's no need to break .
NiLuJe is offline   Reply With Quote
Old 12-09-2018, 04:34 PM   #179
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 856
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Yeah, I didn't want to open up the can of worms that is sophisticated layout. Text layout is HARD, especially especially once one starts dealing with characters that may or may not be printed depending on the situation.

The main reason for choosing libunibreak was because I wanted better line breaking than what was currently in FBInk at the time, but I didn't want to deal with figuring out all the rules myself, especially since I'm a native english speaker, and don't know the rules for other languages.

If I wanted to do 'proper' text layout for an application, I would probably just use Pango and call it a day. Unfortunately, Pango requires fontconfig, which makes it much harder to get working on a barebones linux like the Kobos. Harfbuzz would also work (it's lower level, so requires more work than Pango), but the Harfbuzz documentation is.... anemic.

Last edited by sherman; 12-09-2018 at 04:37 PM.
sherman is offline   Reply With Quote
Old 12-09-2018, 04:50 PM   #180
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I wholeheartedly agree with that HB statement, trying to figure how things were supposed to go in CRe/KOReader was... not fun? .

raqm tries to make this slightly less painful, but devising the best way to do things "right" is still fairly obscure.

Last edited by NiLuJe; 12-09-2018 at 05:45 PM.
NiLuJe is offline   Reply With Quote
Reply

Tags
eips, fbink


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FBInk: A small tool/library to print crap on your screen! NiLuJe Kobo Developer's Corner 282 04-22-2024 02:51 AM
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


All times are GMT -4. The time now is 02:27 AM.


MobileRead.com is a privately owned, operated and funded community.