Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 06-10-2018, 09:50 PM   #1
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Post FBInk: A small tool/library to print crap on your screen!

The lack of a small utility to print messages and images on screen (àla eips on Kindles) has been bugging me (and others, hi @frostschutz! ) for *quite* a while... So, I finally caved, and spent a few days working on this...

So here comes FBInk.
Basically, you feed it a string & a position on screen (row/column), and it'll print it there. Voilà.
There's a few helper flags if you want automagic padding, centering, or both, and it should break long strings over multiple-lines automatically (albeit in the dumbest fashion possible, no hyphenation, that's way out of scope here).

It has zero dependency besides the libc, since it's basically drawing monospaced monochrome glyphs straight to the framebuffer.

It's available as a standalone utility, which includes some of eips's more obscure features (like the ability to trigger specific mxcfb refresh calls without touching the fb at all), and as a C library, which is how I'm using it in KFMon.

Bindings are also available in Go, LuaJIT & Python .

Since v1.2.0, it can also display images, in the most common range of formats, with or without transparency .

Since v1.8.0, thanks to @sherman, it can also render OpenType/TrueType fonts .

NOTE: Up to date binaries (as well as Python bindings) are also always available in KoboStuff.
Attached Files
File Type: zip FBInk-v1.25.0.zip (565.2 KB, 652 views)

Last edited by NiLuJe; 12-05-2022 at 04:01 PM. Reason: Bump to 1.25.0
NiLuJe is offline   Reply With Quote
Old 06-10-2018, 09:51 PM   #2
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
See the KFMon announcement for a few possible caveats in the beta releases.

Basically, I'm throwing this in the wild and asking people to try and break it, to see if I squished all the bugs .

It's currently somewhat verbose, because I suck at basic maths & geometry .

EDIT: Also, no multibyte support right now. I'm vaguely looking into it, but the locales look fairly broken on Kobo, so that's going to be tricky at best...

EDIT²: "fairly broken" was an understatement. Please fix your damn libc, Kobo.

EDIT³: Worked around that shitstorm in 0.9.5. No validation of any kind possible, but we now "speak" UTF-8.

Last edited by NiLuJe; 07-13-2018 at 01:39 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 06-11-2018, 06:50 AM   #3
OfficerAction
Connoisseur
OfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughingOfficerAction can shake the floor when laughing
 
Posts: 80
Karma: 63118
Join Date: May 2018
Device: Kobo Aura One
Thanks for sharing!
I'm sure it will come in handy at some point

Last edited by OfficerAction; 06-11-2018 at 11:59 AM.
OfficerAction is offline   Reply With Quote
Old 06-13-2018, 10:45 AM   #4
Python Master
Member
Python Master began at the beginning.
 
Python Master's Avatar
 
Posts: 13
Karma: 10
Join Date: Mar 2018
Location: Toronto
Device: Kobo Aura One
Works amazing, fun for drawing some ascii art. Tested on the Kobo Aura One and it works
Python Master is offline   Reply With Quote
Old 06-13-2018, 12:58 PM   #5
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@Python Master: I've got UTF-8 handled, so the next version should give you even more possibilities . (There's a few box drawing characters, since the font is basically IBM's venerable VGA font).

With a bit of tinkering, one *might* also be able to use Unscii, since it ships an 8x8 version in Unifont's hex format, which I *think* basically matches the C structures I'm using.

EDIT: Yes, it does, it just needs some massaging to format it as an actual C array, but the actual data is in the same format .

EDIT²: Okay, make that "almost" the same format. I'm rendering glyphs mirrored on the vertical axis at the end of my experiment... (Or mirrored on the horizontal axis with a bit of tweaking)... Or I can do a 90° angle with a code tweak... .
Because of course I initially did my manual test on the single glyph 'A', which happens to be symmetrical... .

Maths is hard. >_<".

Last edited by NiLuJe; 06-13-2018 at 03:12 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 06-13-2018, 05:40 PM   #6
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Because that was bugging me, got the situation under control.

It's not particularly pretty, I'm not sure it's correct, and there's a (minor) code change that makes it incompatible with the default font, but, FOR SCIENCE!

unscii-fantasy .

EDIT: And a few of the other unscii variants, because I'm having fun, and that's an excuse to road test the conversion script .

EDIT²: Got the conversion issue fixed. No need for code tweaks anymore :}.
Attached Thumbnails
Click image for larger version

Name:	unscii-fantasy.png
Views:	1955
Size:	29.0 KB
ID:	164459   Click image for larger version

Name:	unscii-mcr.png
Views:	1351
Size:	28.8 KB
ID:	164460   Click image for larger version

Name:	unscii-thin.png
Views:	1442
Size:	28.9 KB
ID:	164461  

Last edited by NiLuJe; 06-13-2018 at 10:59 PM.
NiLuJe is offline   Reply With Quote
Old 06-13-2018, 06:01 PM   #7
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
I'm having some massive Amiga feels, guys. Don't mind me.
NiLuJe is offline   Reply With Quote
Old 06-13-2018, 07:10 PM   #8
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
There, pushed a new build (0.9.5-28).

This one handles UTF-8 input, correctly honors LF characters (NOT the escape sequence, the actual 0x0A character), and a few minor bugfixes (mainly around padding, and passing multiple long string to the commandline utility).

The LF thing is mainly aimed at being able to tail logs at it and having them flood your screen ;D.
NiLuJe is offline   Reply With Quote
Old 06-14-2018, 03:27 AM   #9
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
@NiLuJe : can I use it to print crap on KSM or KOReader screen ?

(love the font)
cramoisi is offline   Reply With Quote
Old 06-14-2018, 11:40 AM   #10
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@cramoisi: Generally, yes, with some caveats if the software rotation doesn't match the hardware rotation. (i.e., it'll be printing at a 90° angle in KOReader's landscape mode) .

I'd be glad to know how well that actually works, though ^^. And since you still have a 16bpp FW, if the colors are indeed inverted by default .

Last edited by NiLuJe; 06-14-2018 at 11:06 PM.
NiLuJe is offline   Reply With Quote
Old 06-14-2018, 10:03 PM   #11
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
And release v0.9.8, with, among a whole host of other changes, font selection support \o/.

(Those changes include two nasty memory handling related bugfixes, because C is fun! ).

Now, you, too, can play with the Unscii variants (including an 8x16 one, if square cell blocks weren't your style!) .

Last edited by NiLuJe; 06-14-2018 at 11:06 PM.
NiLuJe is offline   Reply With Quote
Old 06-15-2018, 01:38 AM   #12
cramoisi
Librarian
cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.cramoisi did not drink the Kool Aid.
 
Posts: 346
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: kobo gloHD - KA1
Quote:
KOReader's landscape mode
I love it but don't use it since 2 times out of 3 when i come back to filemanager, the landscape mode is kept

I'll try some things this week-end
cramoisi is offline   Reply With Quote
Old 06-19-2018, 08:06 PM   #13
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Released v0.9.10 .

This one either fixed Mark 7 handling to be more correct and future-proof... or broke Mark 7 handling altogether .
NiLuJe is offline   Reply With Quote
Old 06-30-2018, 06:11 PM   #14
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Released v0.9.12 .

This one mainly has new centering code, so that stuff is even more in the middle than before! Yay.

(Also, stuff may be even more broken than before, because basic geometry & arithmetics and me don't mix).
NiLuJe is offline   Reply With Quote
Old 07-06-2018, 03:19 PM   #15
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,499
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Released v0.9.14 (after a 0.9.13) .

This one should fix the broken colors on Kobos running @ 16bpp, as well as placement & orientation when out of Nickel (we no longer print at a 90° angle in these cases ;P).

The main drive was fixing the specific use-case we have for this in KOReader, but this may have fixed it also in general under KSM (as long as there's not another layer of software orientation on top, i.e.: in Upright Portrait mode only).

Again, the power of basic maths & trigonometry was invoked, so I may have screwed things up .
NiLuJe is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Small tool for filling book library in Kobo Aura Paxerus Kobo Developer's Corner 2 12-31-2013 08:05 PM
Small print Broadback Conversion 12 12-12-2011 03:31 PM
Small Tool to change book order (PRS-x50) goaspy Sony Reader 113 10-14-2011 04:28 PM
small print breezeman Introduce Yourself 13 07-03-2011 10:02 AM


All times are GMT -4. The time now is 03:42 AM.


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