summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2022-09-07fix gcc12 warning about malloc sizeThomas E. Dickey1-3/+8
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-07revised fix for gcc 12 compiler warnings in xftextent.cThomas E. Dickey1-5/+5
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-07Fix length check in XftTextExtents*.Adam Sampson1-5/+5
Commit 06a3c0ab6520e368ac936cb1ef172f19957db0fa added length checks of the form "if (len <= 0) return;" to various Xft functions. However, while rendering an empty string is equivalent to doing nothing, asking for the extents of an empty string isn't -- it still needs to fill in the extents structure. This broke text rendering in some applications (e.g. xpdf's Motif GUI). Check for len < 0 in XftTextExtents* instead.
2022-07-09add a null-pointer checkThomas E. Dickey1-0/+2
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09fix new gcc warningsThomas E. Dickey2-22/+25
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09build-fixThomas E. Dickey1-3/+3
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09merge changes by Christian WernerThomas E. Dickey3-139/+234
see note in libXft merge-request #1 at #note_1222314 Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09cleanup new compiler warningsThomas E. Dickey1-14/+15
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09build-fix for c89Thomas E. Dickey1-2/+3
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09Add support for BGRA glyphs display and scalingMaxime Coste4-30/+293
Display is done using an XRender Picture, as XRender glyphs are incompatible with BGRA rendering due to their use of the glyph bitmap as a mask. Scaling is done by averaging all relevant pixel, which gives much better result than nearest pixel sampling while staying simple enough and not too computationally expensive. This enables color emoji rendering support. Fixes: #6 Signed-off-by: Maxime Coste <mawww@kakoune.org> Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09Introduce a _XftCompositeText helper functionMaxime Coste1-34/+49
Dispatch to XRenderCompositeText{8,16,32} based off the given width. Signed-off-by: Maxime Coste <mawww@kakoune.org> Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-09Introduce a _XftCompositeString helper functionMaxime Coste1-18/+43
Dispatch to XRenderCompositeString{8,16,32} based off the given width. Signed-off-by: Maxime Coste <mawww@kakoune.org> Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06errata (cppcheck, clang --analyze, manpage credit)Thomas E. Dickey5-13/+6
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06improve glyph management by relinking to unload least-recently used glyphsThomas E. Dickey1-2/+34
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06when tracking glyph memory usage, unload the oldest glyph rather than randomlyThomas E. Dickey1-1/+12
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06cppcheck/gcc-stricter warnings about printf-formats and operator precedenceThomas E. Dickey2-13/+14
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06fix delinkage of last glyph in font, improve debug-traceThomas E. Dickey1-7/+10
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06add asserts (to help with debugging), update copyright noticesThomas E. Dickey3-36/+43
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06refactor _XftFontUncacheGlyph, separate the two types of loop for readabilityThomas E. Dickey1-19/+35
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06validate linked-list updates with _XftValidateGlyphUsageThomas E. Dickey3-17/+92
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06add option for tracking glyph memory-usage on a linked listThomas E. Dickey6-20/+91
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06add "trackmemusage" property to use in improved _XftFontUncacheGlyphThomas E. Dickey6-27/+70
The linear search used for randomly selecting a glyph to discard is inefficient. This commit provides for a doubly-linked list which could be maintained by the library to quickly discard the least recently used glyph. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-07-06reduce clutter with macros for allocating arraysThomas E. Dickey4-25/+31
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-24add debugging trace for XftDefaultSet()Thomas E. Dickey1-0/+4
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-11remove remaining internal prototypes for obsolete xftcompat.cThomas E. Dickey1-34/+0
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-11move prototype for XftNameUnparse to Xft.hThomas E. Dickey1-1/+0
This entrypoint has "always" been exported, but not declared publicly. It is used for debugging in xterm. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03fix warnings by gcc 11; check if length <= zeroThomas E. Dickey3-0/+66
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03formatting fix, for clarity (no object change)Thomas E. Dickey1-13/+23
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03quiet compiler warning with castThomas E. Dickey1-1/+1
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03quiet compiler warning with castThomas E. Dickey1-1/+1
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03change the internal memory-allocator to use size_tThomas E. Dickey3-19/+22
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03quiet warnings with castsThomas E. Dickey3-5/+5
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03promote font->num_glyphs to FT_UInt or Glyph to fix warningsThomas E. Dickey4-18/+18
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03fix missing-initializer warningThomas E. Dickey1-4/+4
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03cleanup warnings about discarding constThomas E. Dickey6-12/+12
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03quiet unused-parameter warnings with _X_UNUSEDThomas E. Dickey9-18/+18
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-03Fix spelling/wording issuesAlan Coopersmith2-7/+7
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-04-03Remove call to FcNameRegisterObjectTypesKeith Packard3-25/+0
This fontconfig function has been deprecated and no longer does anything. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-04-03Skip 'render' pattern elements with invalid typeKeith Packard1-0/+9
Fontconfig no longer supports the FcNameRegisterObjectTypes API, which means that any Xft custom fields cannot be specified in a fontconfig name as those will always be set to FcTypeUnknown in the pattern. The only one of those we care about is XFT_RENDER, which was used to disable the Render extension, something most apps probably don't need to support in names anyways. Allow the call requesting this value to return FcResultTypeMismatch and pretend that XFT_RENDER is missing from the pattern. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-04-01build-fix for c89Thomas E. Dickey1-2/+2
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2020-04-01fix most type-conversion warnings from gcc-normal, without object-file changesThomas E. Dickey8-175/+175
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2014-10-22XftDrawSrcPicture: Use XRenderCreateSolidFill when availableKeith Packard3-29/+47
Instead of creating 1x1 pictures, use the solid pictures added in Render version 0.10 Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-08Use FT_*_H macros instead of including <freetype/*.h>Julien Cristau1-3/+3
freetype moved its headers around in 2.5.1. Signed-off-by: Julien Cristau <jcristau@debian.org>
2012-03-10Dead code removalJeremy Huddleston1-10/+0
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-03-10Fixup for 550b2f76401c2 which broke bold fontsMikael Magnusson1-4/+0
The commit removed the line AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names FT_GlyphSlot_Embolden) but failed to remove the #if lines that this commit removes, resulting in that code never being executed. Fixes: https://bugs.freedesktop.org/attachment.cgi?id=58280 Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-24Fix undefined ftbit in XftFontLoadGlyphsJeremy Huddleston1-0/+3
https://bugs.freedesktop.org/show_bug.cgi?id=42173 Fixes regression from: 6f1d7bcdd461b1f6cc64370793f52d7c170187d0 Fixed by examining original patch before rebase from: https://bugs.freedesktop.org/show_bug.cgi?id=29151 Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-10Remove fontconfig and freetype ifdef-fu and instead require non-ancinet ↵Jeremy Huddleston2-43/+1
versions of both Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-10compiler noise cleanups related to subpixel LCD supportTom \"spot\" Callaway1-7/+3
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-10-10Subpixel LCD text rendering improvementsTom \"spot\" Callaway4-272/+415
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-28Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith4-7/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com>