Closed rricharz closed 5 years ago
Looking further into cairo, the baseline of the font is the vertical reference. Therefore, it is the lower left corner for characters which do not extend below the base line.
In this context: The Tek4010 only supports upper case characters, but I made the decision to also support lower case characters, because it is otherwise very difficult to use the terminal emulator on systems which differentiate between upper and lower case.
I think, it is therefore the member "ascent" of "cairo_font_extents_t" which is needed to place characters properly in the ARDS decoder. It can be obtained with cairo_font_extents()
See https://cairod.github.io/cairoD/api/cairo/c/cairo/cairo_font_extents_t.html
Fixed and tested proper baseline offset for ARDS. Tested at various screen sizes. The offset is calculated and applied in tube.c. Removed offset in ards.c
Lars, you can now use the ards branch to finish our ARDS decoder.
tube_drawCharacter draws an individual character at the position windowHeight - tube_y0, using cairo_show_text see https://www.cairographics.org/manual/cairo-text.html#cairo-show-text
I haven't found a clear definition of how the character is placed vertically, but I think it's the lower left corner.
I also haven't found a clear definition where the character should be placed vertically in the Tek 4010/4014 manuals, but again I assume it's the lower left corner.
The current version seems to look ok at different windows sizes.
The ARDS manual says the symbols are plotter below and to the right of the current beam position. Therefore, a correction of the character size needs to be applied. vDotsPerChar cannot be used for that, because it is the number of dots in the window between two lines, and not the character height. We need to get that information and either pass it back to the decoder or apply it directly where we obtain the information.