![]() |
#91 |
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: Yep, not in a tagged release yet, hence why I said "master"
![]() There's a binary in this unrelated issue if you want to play with it early. (I'm waiting for the dust to settle around the new Kobo Forma before a new release). |
![]() |
![]() |
![]() |
#92 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Thanks, not familiar with tag/master
![]() Nothing to worry I can wait ![]() On the K3: Code:
[root@kindle bin]# pwd /mnt/us/usbnet/bin [root@kindle bin]# fbink Segmentation fault |
![]() |
![]() |
Advert | |
|
![]() |
#93 |
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
|
Ah, yeah, that would be because it's a K4/K5 binary, oops
![]() Here's the full set ![]() Last edited by NiLuJe; 11-02-2018 at 03:34 PM. Reason: 1.8.0 is now out :) |
![]() |
![]() |
![]() |
#94 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Last edited by PoP; 10-24-2018 at 02:28 PM. Reason: add black border |
![]() |
![]() |
![]() |
#95 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#96 |
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: The static lib? Wouldn't a shared one be more useful?
|
![]() |
![]() |
![]() |
#97 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
^
I (by incompetence) can't appreciate the pros or cons ![]() |
![]() |
![]() |
![]() |
#98 |
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
|
You'd still need to build *something* to make use of either, though
![]() (Or, I, guess, *link* something if you went the hacky way with static objects). |
![]() |
![]() |
![]() |
#99 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,018
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Just to play, I wanted to include:
Code:
cd /mnt/us/tcc tcc -Iinclude -Iinclude/freetype2/freetype -Iinclude/freetype2 -Iinclude/fbink -L/mnt/us/linkfonts/lib/autohint -lfreetype -L/mnt/us/usbnet/bin -lfbink -o fbinkpantspatrol fbinkpantspatrol.c Code:
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <ft2build.h> #include FT_FREETYPE_H #include <fbink.h> int main( ) { FT_Library font_library; FT_Face font_face; FT_Bitmap bitmap; FT_GlyphSlot cur_glyph; FT_Glyph_Metrics glyph_metrics; int glyph_ind; int num_chars; char char_name[256]; int x; // What a FBInk config should look like. Perfectly sane when fully zero-initialized. //struct FBIink_config { // short int row; // y axis (i.e., line), counts down from the bottom of the screen if negative // short int col; // x axis (i.e., column), counts down from the right edge of the screen if negative // uint8_t fontmult; // Font scaling multiplier (i.e., 4 -> x4), 0 means automatic. // uint8_t fontname; // Request a specific font (c.f., FONT_INDEX_T enum) // bool is_inverted; // Invert colors // bool is_flashing; // Request a black flash on refresh // bool is_cleared; // Clear the screen beforehand (honors is_inverted) // bool is_centered; // Center the text (horizontally) // short int hoffset; // Horizontal offset (in pixels) for text position // short int voffset; // Vertical offset (in pixels) for text position // bool is_halfway; // Vertically center the text, honoring row offsets // bool is_padded; // Pad the text with blanks (on the left, or on both sides if is_centered) // uint8_t fg_color; // Requested foreground color for text (c.f., FG_COLOR_INDEX_T enum) // uint8_t bg_color; // Requested background color for text (c.f., BG_COLOR_INDEX_T enum) // bool is_overlay; // Don't draw bg, use inverse of fb's underlying pixel as pen fg color // bool is_bgless; // Don't draw bg (mutually exclusive with is_overlay) // bool is_fgless; // Don't draw fg (takes precendence over is_overlay/is_bgless) // bool is_quiet; // Hide fbink_init()'s hardware setup info (sent to stderr) // bool ignore_alpha; // Ignore any potential alpha channel in source image (i.e., flatten the image) // uint8_t halign; // Horizontal alignment of images (NONE/LEFT, CENTER, EDGE/RIGHT; c.f., ALIGN_INDEX_T enum) // uint8_t valign; // Vertical alignment of images (NONE/TOP, CENTER, EDGE/BOTTOM; c.f., ALIGN_INDEX_T enum) //}; FBInkConfig fbink_config = { 0 }; int fbfd = FBFD_AUTO; //fbink_init API //fbink_init(int fbfd, const FBInkConfig* fbink_config) fbink_init(fbfd, &fbink_config); if ( FT_Init_FreeType( &font_library ) ) exit( 1 ); if ( FT_New_Face( font_library, "pantspatrol.ttf", 0 , &font_face ) ) exit( 1 ); if ( FT_Set_Char_Size( font_face , 0 , 768 , 300 , 300 ) ) exit( 1 ); num_chars = (int)font_face->num_glyphs; FT_Set_Transform( font_face , NULL , NULL ); for ( glyph_ind = 0 ; glyph_ind < num_chars; glyph_ind++ ) { if ( FT_Load_Glyph( font_face, glyph_ind, FT_LOAD_DEFAULT ) ) exit( 1 ); cur_glyph = font_face->glyph; if ( cur_glyph->format != FT_GLYPH_FORMAT_BITMAP ) if ( FT_Render_Glyph( font_face->glyph, FT_RENDER_MODE_MONO ) ) exit( 1 ); if ( FT_Get_Glyph_Name( font_face, glyph_ind, char_name, 16 ) ) exit( 1 ); bitmap = cur_glyph->bitmap; x=glyph_metrics.horiBearingX / 64; // fbink_print_raw_data API // fbink_print_raw_data(int fbfd, // unsigned char* data, // const int w, // const int h , // const size_t len, // short int x_off, // short int y_off, // const FBInkConfig* fbink_config) fbink_print_raw_data(fbfd, &bitmap, bitmap.width, bitmap.rows, bitmap.width*bitmap.rows, x, -glyph_metrics. horiBearingY / 64, &fbink_config); x=x+glyph_metrics.horiAdvance / 64; glyph_metrics = cur_glyph->metrics; printf( "Glyph %d name %s %ld %ld %ld %d %d\n", glyph_ind, char_name, glyph_metrics.horiBearingX / 64, glyph_metrics.horiBearingY / 64, glyph_metrics.horiAdvance / 64, bitmap.width , bitmap.rows ); } return 0; } ![]() Last edited by PoP; 11-01-2018 at 03:11 PM. Reason: spelling |
![]() |
![]() |
![]() |
#100 |
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
|
Yeah, that makes sense
![]() Last edited by NiLuJe; 10-30-2018 at 01:33 AM. |
![]() |
![]() |
![]() |
#101 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
@NiLuJe,
I'm probably flogging a dead horse here but nothing ventured, nothing gained ... ![]() Following on from the Display time when reading thread is there any way that fbink can detect whether the Kobo is currently in inverted colour mode and reverse the background/foreground colours automatically? |
![]() |
![]() |
![]() |
#102 |
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
|
@jackie_w: Nnnnnnyes, but not really
![]() (Technically possible, although potentially not accurately depending on the approach chosen, but in practice a terrible idea). That's much better left to whatever's using FBInk, and toggling its own invert flag (-h) based on whether it finds NM enabled or not ![]() |
![]() |
![]() |
![]() |
#103 |
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
|
@jackie_w: In this case, after taking a look at the nightmode hack, I'd say something like...
Code:
if grep -q "state:invertActive = yes" "/mnt/onboard/.kobo/nightmode.ini" ; then fbink -h .... else fbink .... fi |
![]() |
![]() |
![]() |
#105 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
![]() miniclock.cfg file has default settings Code:
fg_color=BLACK bg_color=WHITE But I don't think this can be the whole problem. Even if I manually set the .ini to invertActive = yes, before rebooting, I still always get black-on-white. It doesn't look like the -h parameter is doing anything. However, in case my practically non-existent shell scripting skills are at fault, I changed miniclock.sh from Spoiler:
to Spoiler:
and I made the changes to frostschutz's Miniclock update dated today. I suspect I'm outstaying my welcome on this annoying little issue, but if you do get any more bright ideas I'll be happy to test them out ... as long as it can be done with a simple Windows PC ![]() |
|
![]() |
![]() |
![]() |
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 |