Commit graph

11 commits

Author SHA1 Message Date
Callum Law
b55023fad3 LibGfx+LibWeb: Resolve font features per font rather than per element
Previously we would resolve font features
(https://drafts.csswg.org/css-fonts-4/#feature-variation-precedence)
per element, while this works for the current subset of the font feature
resolution algorithm that we support, some as yet unimplemented parts
require us to know whether we are resolving against a CSS @font-face
rule, and if so which one (e.g. applying descriptors from the @font-face
rule, deciding which @font-feature-values rules to apply, etc).

To achieve this we store the data required to resolve font features in a
struct and pass that to `FontComputer` which resolves the font features
and stores them with the computed `Font`.

We no longer need to invalidate the font shaping cache when features
change since the features are defined per font (and therefore won't ever
change).
2026-02-02 14:11:43 +00:00
Callum Law
5917a8c1c8 LibGfx+LibWeb: Allow setting FontVariationSettings for default font
While our default font supporting variations is unlikely, this is
nevertheless required for our fallback font to be considered equal to
it's non-default/fallback equivalent (i.e. `font-family: serif`) which
in turn is required for LineBuilder to merge chunks into a single
fragment.
2026-02-02 14:11:43 +00:00
Marcos Del Sol Vives
abcc5bc16d LibWeb: Support multiple emoji/symbol fonts 2025-11-03 09:56:25 +00:00
Jelle Raaijmakers
e96fd53eda Revert "LibWebView: Add Arial Unicode MS to the list of Sans Serif (...)
(...) fallbacks"

This reverts commit 9e7b40747f. This
caused most bold headings to display as regular headings, since Arial
Unicode MS does not support other styles (as opposed to Arial).

We need a better font selection algorithm to properly support selecting
fonts for specific glyphs. Issue #2332 exists to keep track of
supporting less frequently used glyphs.
2025-07-08 09:17:32 -04:00
Semyon Danilov
9e7b40747f LibWebView: Add Arial Unicode MS to the list of Sans Serif fallbacks 2025-06-28 12:10:35 +01:00
blukai
e356a4bd01 LibGfx: Rely on fontconfig(if enabled) for font directory resolution
this commit also introduces GlobalFontConfig class that is now
responsible for fontconfig initialization. it seems sane, even thought
FcInit's docs state that if the default configuration has already been
loaded, this routine does nothing.
2025-05-26 12:14:29 -06:00
blukai
4b3691ff39 LibCore+LibGfx: Move font_directories from LibCore to LibGfx
the goal is to rely on fontconfig for font directory resolution. it
doesn't seem like it would be appropritate to call to fontconfig funcs
from within the LibCore.

i'm not 100% confident that FontDatabase is the correct place.. seems
okay?
2025-05-26 12:14:29 -06:00
Aliaksandr Kalenik
0b8b690f92 LibWeb+LibWebView: Allow to specify default font size in FontPlugin
Instead of always assuming 12pt size for default font, explicitly pass
it as a parameter.
2025-01-02 10:47:21 +01:00
Andrew Kaster
37f7f02d69 LibWebView: Accept Noto Sans Mono as a monospace font 2024-12-31 13:42:50 -07:00
Pavel Shliak
8a07131229 LibGfx: Clean up #include directives
We actually include what we use where we use it.
This change aims to improve the speed of incremental builds.
2024-11-20 21:13:23 +01:00
Timothy Flynn
a14937c45e LibWebView+Services+UI: Move the Web plugins to LibWebView 2024-11-11 07:35:43 -05:00
Renamed from UI/FontPlugin.cpp (Browse further)