- use demo strings in UTF-8 encoding rather than converting them
which also simplifies the code
- replace some hard-coded width and pos. values with constants
- enlarge width of text widgets (left column) of the main window
- replace display of Unicode range U+D800 ... U+DFFF with a text
explaining that this space is used by UTF-16 surrogate pairs to
prevent warning messages about invalid Unicode text.
This commit makes platforms Windows and macOS compute string widths
with the same mechanism as what is in place for platforms Wayland/X11:
- the width of a string containing a single codepoint is computed and
memorized in the table of character widths;
- the width of a string containing several codepoints is computed as
such rather than as the sum of the widths of its composing characters.
This commit also fixes how text input under Windows is processed
when a character needs encoding as a surrogate.
The result is that FLTK text widgets input and draw correctly also
complex emojis encoded with context-dependent codepoints.
Documentation only: users must load a font with fl_font(face, size)
before measuring text with methods like fl_measure(), fl_height(),
fl_width(), fl_text_extents() etc.
#146: Add access to scrollbars widget in Fl_Help_View
- new methods are Fl_Help_View::scrollbar()
and Fl_Help_View::hscrollbar(), taking inspiration from
Fl_Browser.
Set default DPI to 300 in fl_write_png
Previously, the DPI value was completely random, resulting
in some interesting scaling when reading the png in other apps.
Fix address sanitizer exception for macOS native file chooser
The `memcmp` call would crash in Adress sanitizer if the memory compare
would run into an undefined buffer. `memcmp` is not guaranteed to stop
reading a buffer if a difference is found.
1. src/Fl_add_idle.cxx: add missing parameter docs,
backport documentation of several functions from 1.5
2. FL/fl_draw.H: rename 1st parameter of fl_draw_pixmap(...) from
'data' to 'cdata'.
Backported from 3114ef0e2f
- use Fl_Terminal instead of Fl_Browser for prime display
- add Fl::lock()/Fl::unlock() at thread initialization
- format "Max Prime" output as integer number
- use a fixed font for better readability
- close all windows when the user closes one of them
- use standard background and text colors
Note: This commit is a compromise. The version in FLTK 1.5 uses
std::vector<> and can't be fully backported to 1.4.
- allocate a new struct 'load_stat' on the heap
- use struct load_stat to open image file (fp) and for error counters
The previous fix of #1207 unfortunately decremented volatile variables
which caused (plausible) compiler warnings by clang.
Backported from master (340caa2dc3)