From f5bbe606770a4327535e459f106bd4a7158eb6e0 Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Sat, 19 Jul 2025 17:02:57 +0200 Subject: Text TV BornHack renamed, 2024 & 2025 picture, change of plans --- Text TV BornHack/2024.webp | Bin 0 -> 287338 bytes Text TV BornHack/2025.webp | Bin 0 -> 298102 bytes Text TV BornHack/Anti aliased text.png | Bin 0 -> 2489 bytes Text TV BornHack/Anti aliasing turned off.png | Bin 0 -> 1781 bytes Text TV BornHack/Mock up.png | Bin 0 -> 12158 bytes Text TV BornHack/Text TV CRT.png | Bin 0 -> 6315524 bytes Text TV BornHack/Thumbnail.png | Bin 0 -> 107871 bytes Text TV BornHack/index.md | 134 +++++++++++++++++++++ .../Anti aliased text.png | Bin 2489 -> 0 bytes .../Anti aliasing turned off.png | Bin 1781 -> 0 bytes Text TV Pixelflut BornHack 2024/Mock up.png | Bin 12158 -> 0 bytes Text TV Pixelflut BornHack 2024/Text TV CRT.png | Bin 6315524 -> 0 bytes Text TV Pixelflut BornHack 2024/Thumbnail.png | Bin 107871 -> 0 bytes Text TV Pixelflut BornHack 2024/index.md | 126 ------------------- 14 files changed, 134 insertions(+), 126 deletions(-) create mode 100644 Text TV BornHack/2024.webp create mode 100644 Text TV BornHack/2025.webp create mode 100644 Text TV BornHack/Anti aliased text.png create mode 100644 Text TV BornHack/Anti aliasing turned off.png create mode 100644 Text TV BornHack/Mock up.png create mode 100644 Text TV BornHack/Text TV CRT.png create mode 100644 Text TV BornHack/Thumbnail.png create mode 100644 Text TV BornHack/index.md delete mode 100644 Text TV Pixelflut BornHack 2024/Anti aliased text.png delete mode 100644 Text TV Pixelflut BornHack 2024/Anti aliasing turned off.png delete mode 100644 Text TV Pixelflut BornHack 2024/Mock up.png delete mode 100644 Text TV Pixelflut BornHack 2024/Text TV CRT.png delete mode 100644 Text TV Pixelflut BornHack 2024/Thumbnail.png delete mode 100644 Text TV Pixelflut BornHack 2024/index.md diff --git a/Text TV BornHack/2024.webp b/Text TV BornHack/2024.webp new file mode 100644 index 0000000..c7231e7 Binary files /dev/null and b/Text TV BornHack/2024.webp differ diff --git a/Text TV BornHack/2025.webp b/Text TV BornHack/2025.webp new file mode 100644 index 0000000..8aa530f Binary files /dev/null and b/Text TV BornHack/2025.webp differ diff --git a/Text TV BornHack/Anti aliased text.png b/Text TV BornHack/Anti aliased text.png new file mode 100644 index 0000000..739c551 Binary files /dev/null and b/Text TV BornHack/Anti aliased text.png differ diff --git a/Text TV BornHack/Anti aliasing turned off.png b/Text TV BornHack/Anti aliasing turned off.png new file mode 100644 index 0000000..628d80c Binary files /dev/null and b/Text TV BornHack/Anti aliasing turned off.png differ diff --git a/Text TV BornHack/Mock up.png b/Text TV BornHack/Mock up.png new file mode 100644 index 0000000..e633493 Binary files /dev/null and b/Text TV BornHack/Mock up.png differ diff --git a/Text TV BornHack/Text TV CRT.png b/Text TV BornHack/Text TV CRT.png new file mode 100644 index 0000000..332da7d Binary files /dev/null and b/Text TV BornHack/Text TV CRT.png differ diff --git a/Text TV BornHack/Thumbnail.png b/Text TV BornHack/Thumbnail.png new file mode 100644 index 0000000..1bd926a Binary files /dev/null and b/Text TV BornHack/Thumbnail.png differ diff --git a/Text TV BornHack/index.md b/Text TV BornHack/index.md new file mode 100644 index 0000000..5cf16f5 --- /dev/null +++ b/Text TV BornHack/index.md @@ -0,0 +1,134 @@ +--- +description: Website imitating teletext aka *Tekst-TV* featuring schedule +created: 2024-07-07 +--- + +## --> [text-tv.bornhack.node5.net](https://text-tv.bornhack.node5.net/) <-- + +![Text TV CRT](Text TV CRT.png) +![](2025.webp) +![](2024.webp) + +## Idea + +This years BornHack (2024) will feature an even cooler Pixelflut setup, which inspired me to make something for it. +An important goal was to have something with a low barrier of entry to interact with it. +My first idea involved a keyboard presented at the Pixelflut setup, +allowing one to type messages to be displayed on screen. +Then later i got the idea to make it Text TV themed, this works well with the nerdy culture, and allows me to add a +schedule, and get user interaction through a "news" section. + +### Mock up + +![Mock up](Mock up.png) + +### Inspiration + + +--- + +## Renderer coding + +### Text rendering in C using pango & cairo + +Based on a cairo pixel flut code sample from a fellow hacker, which i could expand to import and image, rather easily, +and render text, which worked, but it was anti aliased, making it look horible in the small format. + +![Anti aliased text](Anti aliased text.png) + +Top is gimp mock up text, +bottom is pango cairo rendered text + +### Turning off anti aliasing + +This was annoying, because `cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);` didn't work, +it had to be done in pango context. + +[Change font rendering (non-antialiased) with pango - stackoverflow.com](https://stackoverflow.com/questions/16106659/change-font-rendering-non-antialiased-with-pango#answer-73221211) + +An answer in this stack overflow question, mentions that: +*"In C you can turn off anti-aliasing when drawing with Pangocairo like this:"* +```c +cairo_font_options_t *options = cairo_font_options_create(); +cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE); +pango_cairo_context_set_font_options(context, options); +cairo_font_options_destroy(options); +``` + +Next problem then, is getting the context. + +I found out how to do this in: [pango examples cairoshape.c - gitlab.com](https://gitlab.gnome.org/GNOME/pango/-/blob/239e030e4f38f0b7b899a8a405437601daf2860d/examples/cairoshape.c#L137) + +Using `layout = pango_cairo_create_layout (cr);` and `pango_layout_get_context (layout);` + +This means i can now turn off, anti aliasing + +Here's a code sample: + +```c + cairo_surface_t *surface; + cairo_t *cr; + + surface = cairo_image_surface_create_for_data( + f->image, f->format, + f->width, f->height, f->stride); + cr = cairo_create(surface); + + //cairo_scale (cr, 2, 2); + //cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); + + int w, h; + cairo_surface_t *image; + + image = cairo_image_surface_create_from_png ("../base.png"); + w = cairo_image_surface_get_width (image); + h = cairo_image_surface_get_height (image); + //cairo_translate (cr, 0, 1080 - h); + + cairo_set_source_surface (cr, image, 0, 0); + cairo_paint (cr); + + // Set up the Pango Cairo context + PangoLayout *layout = pango_cairo_create_layout(cr); + PangoFontDescription *font_desc = pango_font_description_from_string("Monospace 7"); + //pango_font_description_set_size(font_desc, 8 * PANGO_SCALE); + pango_layout_set_font_description(layout, font_desc); + pango_font_description_free(font_desc); + + // Turn off antialias + PangoContext *pango_context = pango_layout_get_context (layout); + cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); + cairo_font_options_t *options = cairo_font_options_create(); + cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE); + pango_cairo_context_set_font_options(pango_context, options); + cairo_font_options_destroy(options); + + // Move + cairo_translate (cr, 6, 115); + + // Set the text to display + pango_layout_set_text(layout, "Hello World!", -1); + + // Render the layout + cairo_set_source_rgb(cr, 1, 1, 1); // Set color to white + pango_cairo_show_layout(cr, layout); + + // Clean up + g_object_unref(layout); + + + cairo_destroy (cr); + cairo_surface_destroy(surface); +``` + +Which renderes non-anti-aliased text + +![Anti aliasing turned off](Anti aliasing turned off.png) + +Again, top is gimp mock up text, +bottom is pango cairo rendered text + +--- + +So 2024 Bornhack happened, sadly the pixel flut screen died, so i shifted from pixel flut to a website. +Which was featured at the bar in 2024 and in our village in 2025 diff --git a/Text TV Pixelflut BornHack 2024/Anti aliased text.png b/Text TV Pixelflut BornHack 2024/Anti aliased text.png deleted file mode 100644 index 739c551..0000000 Binary files a/Text TV Pixelflut BornHack 2024/Anti aliased text.png and /dev/null differ diff --git a/Text TV Pixelflut BornHack 2024/Anti aliasing turned off.png b/Text TV Pixelflut BornHack 2024/Anti aliasing turned off.png deleted file mode 100644 index 628d80c..0000000 Binary files a/Text TV Pixelflut BornHack 2024/Anti aliasing turned off.png and /dev/null differ diff --git a/Text TV Pixelflut BornHack 2024/Mock up.png b/Text TV Pixelflut BornHack 2024/Mock up.png deleted file mode 100644 index e633493..0000000 Binary files a/Text TV Pixelflut BornHack 2024/Mock up.png and /dev/null differ diff --git a/Text TV Pixelflut BornHack 2024/Text TV CRT.png b/Text TV Pixelflut BornHack 2024/Text TV CRT.png deleted file mode 100644 index 332da7d..0000000 Binary files a/Text TV Pixelflut BornHack 2024/Text TV CRT.png and /dev/null differ diff --git a/Text TV Pixelflut BornHack 2024/Thumbnail.png b/Text TV Pixelflut BornHack 2024/Thumbnail.png deleted file mode 100644 index 1bd926a..0000000 Binary files a/Text TV Pixelflut BornHack 2024/Thumbnail.png and /dev/null differ diff --git a/Text TV Pixelflut BornHack 2024/index.md b/Text TV Pixelflut BornHack 2024/index.md deleted file mode 100644 index 6c74b6e..0000000 --- a/Text TV Pixelflut BornHack 2024/index.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -description: Pixelflut emulating teletext aka *Tekst-TV* featuring schedule, and user content *news* section -created: 2024-07-07 ---- - -![Text TV CRT](Text TV CRT.png) - -## Idea - -This years BornHack will feature an even cooler Pixelflut setup, which inspired me to make something for it. -An important goal was to have something with a low barrier of entry to interact with it. -My first idea involved a keyboard presented at the Pixelflut setup, -allowing one to type messages to be displayed on screen. -Then later i got the idea to make it Text TV themed, this works well with the nerdy culture, and allows me to add a -schedule, and get user interaction through a "news" section. - -### Mock up - -![Mock up](Mock up.png) - -### Inspiration - - ---- - -## Renderer coding - -### Text rendering in C using pango & cairo - -Based on a cairo pixel flut code sample from a fellow hacker, which i could expand to import and image, rather easily, -and render text, which worked, but it was anti aliased, making it look horible in the small format. - -![Anti aliased text](Anti aliased text.png) - -Top is gimp mock up text, -bottom is pango cairo rendered text - -### Turning off anti aliasing - -This was annoying, because `cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);` didn't work, -it had to be done in pango context. - -[Change font rendering (non-antialiased) with pango - stackoverflow.com](https://stackoverflow.com/questions/16106659/change-font-rendering-non-antialiased-with-pango#answer-73221211) - -An answer in this stack overflow question, mentions that: -*"In C you can turn off anti-aliasing when drawing with Pangocairo like this:"* -```c -cairo_font_options_t *options = cairo_font_options_create(); -cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE); -pango_cairo_context_set_font_options(context, options); -cairo_font_options_destroy(options); -``` - -Next problem then, is getting the context. - -I found out how to do this in: [pango examples cairoshape.c - gitlab.com](https://gitlab.gnome.org/GNOME/pango/-/blob/239e030e4f38f0b7b899a8a405437601daf2860d/examples/cairoshape.c#L137) - -Using `layout = pango_cairo_create_layout (cr);` and `pango_layout_get_context (layout);` - -This means i can now turn off, anti aliasing - -Here's a code sample: - -```c - cairo_surface_t *surface; - cairo_t *cr; - - surface = cairo_image_surface_create_for_data( - f->image, f->format, - f->width, f->height, f->stride); - cr = cairo_create(surface); - - //cairo_scale (cr, 2, 2); - //cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); - - int w, h; - cairo_surface_t *image; - - image = cairo_image_surface_create_from_png ("../base.png"); - w = cairo_image_surface_get_width (image); - h = cairo_image_surface_get_height (image); - //cairo_translate (cr, 0, 1080 - h); - - cairo_set_source_surface (cr, image, 0, 0); - cairo_paint (cr); - - // Set up the Pango Cairo context - PangoLayout *layout = pango_cairo_create_layout(cr); - PangoFontDescription *font_desc = pango_font_description_from_string("Monospace 7"); - //pango_font_description_set_size(font_desc, 8 * PANGO_SCALE); - pango_layout_set_font_description(layout, font_desc); - pango_font_description_free(font_desc); - - // Turn off antialias - PangoContext *pango_context = pango_layout_get_context (layout); - cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE); - cairo_font_options_t *options = cairo_font_options_create(); - cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_NONE); - pango_cairo_context_set_font_options(pango_context, options); - cairo_font_options_destroy(options); - - // Move - cairo_translate (cr, 6, 115); - - // Set the text to display - pango_layout_set_text(layout, "Hello World!", -1); - - // Render the layout - cairo_set_source_rgb(cr, 1, 1, 1); // Set color to white - pango_cairo_show_layout(cr, layout); - - // Clean up - g_object_unref(layout); - - - cairo_destroy (cr); - cairo_surface_destroy(surface); -``` - -Which renderes non-anti-aliased text - -![Anti aliasing turned off](Anti aliasing turned off.png) - -Again, top is gimp mock up text, -bottom is pango cairo rendered text - -- cgit 1.4.1