about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-12-14 19:27:58 +0100
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-12-14 19:33:46 +0100
commitdcea971e7d66fa41b14e3a53fb1127dedd698fee (patch)
tree36d8225e63e5e68b618cd4445db6057fdd3b885c
parentcac37f7bcfd90bad72c75b26df3cdbcf70d8e364 (diff)
doc(bs-renderflipdot): add section about flipdot interaction
-rw-r--r--README.md34
-rw-r--r--doc/flipdot-render.pngbin0 -> 40513 bytes
2 files changed, 33 insertions, 1 deletions
diff --git a/README.md b/README.md
index 452c0f2..17bdfc8 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
  █ ███    ████ 
 ```
 
-> at least it's better than PIL.ImageFont
+> at least better than PIL.ImageFont
 
 toy font rendering for low pixelcount high contrast displays,
 i. e. [openlab's flipdot display](https://wiki.openlab-augsburg.de/Flipdots).
@@ -79,6 +79,38 @@ $ ./bs-renderflipdot.exe -f fonts/unifont.ttf -f fonts/unifont_upper.ttf -n "Gre
                                                           ████                              
 ```
 
+## flipdot interaction
+
+![An example where buchstabensuppe does an admirable job rendering a string onto a simulated flipdot display](doc/flipdot-render.png)
+
+the picture above shows buchstabensuppe being used to render text
+onto a simulated flipdot display. take notice especially of the following:
+
+* fallback fonts are supported: the emoji is not found in `unifont.ttf`,
+  but rendered from `unifont_upper.ttf`
+* correct text shaping is supported (as far as the font supports it):
+  g̈ which consists of two codepoints is rendered as a combined cluster
+  consisting of two glyphs.
+
+[bs-renderflipdot.c](./bs-renderflipdot.c) is a simple example showing
+how to interact with a flipdot display. mainly it involves:
+
+* rendering a string to a bitmap using `bs_render_utf8_string`
+* making sure that the dimensions of the display and the image
+  match with `bs_bitmap_extend`
+* processing the resulting bitmap using `bs_bitmap_map`
+* producing a compacted bitmap array for the display
+  using `bs_view_bitarray` ready to sent via UDP
+
+you can also play around with its cli: the following command
+renders “Hello World” black on white using GNU Unifont onto
+a flipdot display (or simulator) running on `localhost:2323`.
+See `./bs-renderflipdot.exe -?` for more usage details.
+
+```
+./bs-renderflipdot.exe -f /path/to/unifont.ttf -f /path/to/unifont_upper.ttf -i "Hello World"
+```
+
 ## caveats
 
 * buchstabensuppe loads all fonts into memory and keeps them there pretty much
diff --git a/doc/flipdot-render.png b/doc/flipdot-render.png
new file mode 100644
index 0000000..090076f
--- /dev/null
+++ b/doc/flipdot-render.png
Binary files differ