| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Another case where using a GPtrArray instead of
a GArray of pointers is nicer.
|
|
|
|
|
| |
We require harbuzz to be at least 2.0.0 for a while now.
No need to check that version at runtime.
|
|
|
|
|
|
|
|
| |
harfbuzz creates a face, but doesn't seem to find
any glyphs in woff fonts, so filter them out.
Sadly, fontfonfig does not have useful format information
about this, so we need to crudely filter by filename.
|
| |
|
|
|
|
|
|
|
| |
There was a data race in accessing the ref_count of this struct; now
with g_atomic_rc_box it's done properly across threads.
Fixes https://gitlab.gnome.org/GNOME/pango/-/issues/571
|
| |
|
|
|
|
|
|
|
|
|
| |
We were trying to cut short the wait for FcInit in
pango_fc_font_map_set_config. But there was a thinko:
while it is true that the fontmap which had set_config
called on it does not need to wait for FcInit anymore,
other threads fontmaps still do. Instead of making this
more complicated, just drop the optimization.
|
|
|
|
|
|
|
| |
The return value is owned by Pango. transfer=none doesn't
really work for non-GObject types, so just spell it out.
Fixes: #572
|
|
|
|
|
|
| |
Remove a boatload of "or %NULL" from nullable parameters
and return values. gi-docgen generates suitable text from
the annotation that we don't need to duplicate.
|
|
|
|
|
|
|
|
|
|
| |
GTask requires a running mainloop, otherwise we
end up leaking task objects and their associated
data. This is not a problem in GTK applications,
but it does show up in batch operation, such as
with lilypond.
To avoid this problem, use plain threads.
|
|
|
|
|
|
|
| |
Originally suggested by Philipp Withnall in
https://bugzilla.gnome.org/show_bug.cgi?id=778655
Fixes: #268
|
|
|
|
|
|
|
| |
We were erroneously setting fc_initialized back to 1
in one place. But now 1 means 'wait for the FcInit thread
that is already underway. Setting it to 2 restores the
intention.
|
|
|
| |
This reverts merge request !309
|
|
|
|
|
|
|
| |
We were erroneously setting fc_initialized back to 1
in one place. But now 1 means 'wait for the FcInit thread
that is already underway. Setting it to 2 restores the
intention.
|
|
|
|
|
|
|
| |
When multiple fontmaps are created in quick
succession, we would send off a thread to call
FcInit for each one of them, which is not really
necessary. Just do it once.
|
|
|
|
|
| |
The g_memdup() function is replaced by a safer version in newer versions
of GLib.
|
| |
|
|
|
|
| |
Convert link syntax and add summaries.
|
|
|
|
|
|
| |
Replace gtk-doc'isms and use gi-docgen links instead.
Cross-gir links are still an open issue.
|
|
|
|
|
| |
We want to use pure markdown, since docbook
is going away as the intermediate format.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the recently introduced threading for fontconfig
calls, we introduced an ordering issue where the fontmap
may die before an outstanding thread returns, and then
the code that unrefs the pattern object tries to remove
it from the fontmap cache.
Prevent that by giving each thread a strong ref on the
fontmap while it runs.
Fixes: #537
|
|
|
|
|
| |
Add sysprof marks around the expensive fontconfig
calls, and for when we are waiting on them.
|
|
|
|
|
|
|
|
|
|
| |
With a big fontconfig configuration, FcInit takes some time
(60-100ms on my system). Doing this work off the main thread
can potentially avoid blocking other work.
To take advantage of this, GTK calls pango_cairo_font_map_get_default()
early to initiate the creation of a fontmap, thereby triggering the
FcInit() call.
|
|
|
|
|
|
|
|
|
|
| |
fontconfig is thread-safe, so we can do calls that
can take several milliseconds to complete in a thread.
This patch does that for FcFontSetMatch and FcFontSetSort.
It is a win, at least for FcFontSetSort, since it
reduces the time that the main thread spends in
pango_fc_patterns_get_font_pattern for i > 0 from
around 10 to 6 milliseconds.
|
|
|
|
|
|
|
| |
We have filtered-by-format lists of fonts available
now, so we should use them to ensure we always operate
on the same set of fonts. Also, fix another case of
passing NULL for the config.
|
|
|
|
|
|
| |
The fontconfig configuration changes rarely, so we can avoid
unnecessary work by only doing the filtering by supported formats
once, and keeping the result.
|
|
|
|
|
|
|
|
|
| |
Passing NULL for a config argument in a fontconfig
api means we are using the default configuration,
which may be different from the one the fontmap
is supposed to be using.
Fix an instance of this in pango_fc_face_list_sizes.
|
|
|
|
|
|
|
|
|
| |
Passing NULL for a config argument in a fontconfig
api means we are using the default configuration,
which may be different from the one the fontmap
is supposed to be using.
Fix an instance of this in pango_fc_fontset_load_next_font.
|
|
|
|
|
|
|
|
|
|
|
| |
We are using the size from the FcPattern. For scalable
bitmap fonts, this has been scaled to match the requested
pixel size. To make a font description that can be turned
back into a FcPattern and roundtrip successfully, we need
to undo that scaling. Thankfully, fontconfig leaves the
pixelsizefixupfactor in the pattern, so it is easy to do.
Fixes: #530
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fonts are amazing, and not in a good way. My system has
fonts with 0, 1, 2 "Regular" faces. It also has fonts
where the "Regular" face is, in fact, bold.
So, we need to work even harder to return a reasonable
face when asked about the default. We already make
a determination of faces that we consider 'regular'
when we create the faces initially. Just keep that
information for later reuse.
|
|
|
|
|
|
|
|
|
| |
pango_font_family_get_face() is documented as nullable,
so we are technically within our rights to return NULL,
but that is unexpected when passing NULL to get the
default face, and the family has faces. So, try a little
harder by returning the first face if we don't find
a face with the name "Regular".
|
|
|
|
|
|
| |
Make pango_font_family_list_faces() return faces
sorted by slant and weight. This makes the font
chooser look much less random.
|
|\
| |
| |
| |
| |
| |
| | |
Add pango_fc_font_map_set_default_substitute
Closes #83
See merge request GNOME/pango!191
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
added:
pango_fc_font_map_set_default_substitute
pango_fc_font_map_default_substitute_changed
deprecated:
pango_ft2_font_map_set_default_substitute
pango_ft2_font_map_changed
pango_xft_font_map_set_default_substitute
pango_xft_font_map_changed
Now PangoCairoFcFontMap will call what is passed to
pango_fc_font_map_set_default_substitute when it is time.
The deprecated functions make calls to the parent (FC) class now.
The user-supplied callbacks are executed in the exact same places as
before.
|
| |
| |
| |
| |
| |
| |
| | |
This really belongs into PangoFont, but we're out of
room in the PangoFontClass struct for vfuncs, so this
will have to remain backend-specific functionality
for now.
|
| |
| |
| |
| |
| | |
This #if snuck in as part of efa66e7b634050ef3.
No need to keep it around.
|
| |
| |
| |
| |
| |
| | |
We can do the format filtering on the unsorted
font lists. Sorting the same list twice may be
fast, but there's still some setup overhead.
|
| |
| |
| |
| |
| | |
We were needlessly duplicating patters when we
could have just referenced them.
|
| |
| |
| |
| |
| |
| |
| | |
If we bail out early, we end up with uninitialised data and no way for a
caller to know that happened.
Fixes: #489
|
|/
|
|
|
| |
Fixes https://gitlab.gnome.org/GNOME/pango/-/issues/484 and
https://gitlab.gnome.org/GNOME/pango/-/issues/457
|
|
|
|
| |
I believe this was meant to assign to variable and not res.
|
|
|
|
|
|
| |
We don't have introspection for fontconfig and freetype2 data types.
While we do have introspection for Harfbuzz, it doesn't really work.
|
|
|
|
|
|
|
| |
- Clarify that the function can return NULL
- Fix annotations
- Allow passing NULL as name to get a guaranteed default face.
- Map the default name to "Regular" in the FC backend
|
|
|
|
| |
We can implement this a bit better in the fontconfig backend.
|
|
|
|
|
| |
Reimplement GListModel in the fontconfig backend.
This implementation avoids memory copies.
|
|
|
|
|
| |
Since we've run out of slots in PangoFontClass,
this is implemented with a vfunc in PangoFontMapClass.
|
| |
|
|
|
|
| |
This lets us get a face by name.
|
|
|
|
| |
This lets us get a PangoFontFamily by name.
|
|
|
|
|
| |
Apparently, people have fonts without formats,
so better don't assert, just silently skip those.
|