gpforge
An advanced bitmap font editor
Loading...
Searching...
No Matches
preview.h File Reference

The preview, the variant strip and the accented letters strip. More...

#include <widgets/gp_widgets.h>

Go to the source code of this file.

Functions

void gpf_preview_draw (gp_widget *self)
 Paints the sample text into the preview pixmap.
void gpf_strip_draw (gp_widget *self)
 Paints the variant strip.
int gpf_strip_input (gp_event *ev)
 Handles an input event on the variant strip.
void gpf_deps_draw (gp_widget *self)
 Paints the accented letters strip.
int gpf_deps_input (gp_event *ev)
 Handles an input event on the accented letters strip.

Detailed Description

The preview, the variant strip and the accented letters strip.

The preview and the variant strip both draw through gfxprim's own text renderer with the resolved variant compiled into a gp_font_face, so what is on the screen is what a consumer of the font would render, bearings included. Neither follows the table's zoom: the preview is there to show the font at its own size, and the strip is a selector.

The accented letters strip lists the accented forms of the selected letter, or the letters that wear the selected mark, drawn as table cells.

Definition in file preview.h.

Function Documentation

◆ gpf_deps_draw()

void gpf_deps_draw ( gp_widget * self)

Paints the accented letters strip.

Lists the accented forms of the selected letter, or of the letter the selected glyph is an accented form of. When a mark is selected it lists the letters that wear it instead, each drawn composed with the mark being edited. The selected glyph is highlighted, on gpf_gui_back_color().

Parameters
selfThe accented letters strip pixmap widget.

Definition at line 510 of file preview.c.

References gpf_glyph::accent, gpf_glyph::bits, gpf_glyph::code, GPF_MIN, gpf_resolve(), and gpf_cell::w.

◆ gpf_deps_input()

int gpf_deps_input ( gp_event * ev)

Handles an input event on the accented letters strip.

A click selects the glyph without moving the table, and a click on a letter the font has not got creates it from its base and accent. The wheel scrolls the strip by a cell.

Parameters
evAn input event.
Returns
Non-zero when the event was handled.

Definition at line 560 of file preview.c.

References GPF_MIN, gpf_resolve(), and gpf_resolved_clear().

◆ gpf_preview_draw()

void gpf_preview_draw ( gp_widget * self)

Paints the sample text into the preview pixmap.

Draws the sample of the block being browsed, the selected glyph between reference glyphs, the line typed into the preview text box, and the underline, strikethrough and overline the check boxes ask for, all in the variant being edited. Each line is drawn at 1x and 2x, and at 3x as well when the preview has room for all of them.

Parameters
selfThe preview pixmap widget.

Definition at line 192 of file preview.c.

◆ gpf_strip_draw()

void gpf_strip_draw ( gp_widget * self)

Paints the variant strip.

The selected glyph once per variant, as each of them resolves it, with the variant being edited highlighted, on gpf_gui_back_color().

Parameters
selfThe variant strip pixmap widget.

Definition at line 342 of file preview.c.

References GPF_MAX, and GPF_VARIANTS.

◆ gpf_strip_input()

int gpf_strip_input ( gp_event * ev)

Handles an input event on the variant strip.

The strip is the variant selector, there is no separate widget for it: a click on a cell switches to its variant.

Parameters
evAn input event.
Returns
Non-zero when the event was handled.

Definition at line 613 of file preview.c.

References GPF_MAX, and GPF_VARIANTS.