Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-10-2018, 08: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
Post FBInk: A small tool/library to print crap on your screen!

The lack of a small utility to print messages 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.
Attached Files
File Type: zip FBInk-v0.9.10-17-g9a4cc21.zip (76.7 KB, 0 views)

Last edited by NiLuJe; Today at 08:43 PM. Reason: Bumped to 0.9.10-17
NiLuJe is offline   Reply With Quote
Advert
Old 06-10-2018, 08: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
See the KFMon announcement for a few possible caveats in the current release.

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; 06-13-2018 at 06:13 PM.
NiLuJe is offline   Reply With Quote
Old 06-11-2018, 05:50 AM   #3
OfficerAction
Member
OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.OfficerAction for a long time would go to bed early.
 
Posts: 11
Karma: 17850
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 10:59 AM.
OfficerAction is offline   Reply With Quote
Old 06-13-2018, 09:45 AM   #4
Python Master
Member
Python Master began at the beginning.
 
Python Master's Avatar
 
Posts: 11
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, 11:58 AM   #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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
@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 02:12 PM.
NiLuJe is offline   Reply With Quote
Old 06-13-2018, 04: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
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:	72
Size:	29.0 KB
ID:	164459   Click image for larger version

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

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

Last edited by NiLuJe; 06-13-2018 at 09:59 PM.
NiLuJe is offline   Reply With Quote
Old 06-13-2018, 05: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
I'm having some massive Amiga feels, guys. Don't mind me.
NiLuJe is offline   Reply With Quote
Old 06-13-2018, 06: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
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, 02: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: 309
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: Kobo Aura - 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, 10: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
@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 10:06 PM.
NiLuJe is offline   Reply With Quote
Old 06-14-2018, 09: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
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 10:06 PM.
NiLuJe is offline   Reply With Quote
Old 06-15-2018, 12: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: 309
Karma: 72225
Join Date: Apr 2015
Location: Liège - Belgium
Device: Kobo Aura - 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 Yesterday, 07: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: 7,170
Karma: 6810963
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O
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
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:05 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


All times are GMT -4. The time now is 09:10 PM.


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