| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
The previous approach using foreground colors in user fonts does not
work for gradients since the foreground color is not available at the
time of recording.
Add a new function cairo_user_scaled_font_get_foreground_source() that
can be called by the color render function to retrieve the foreground
pattern. Calling this function signals to cairo that the foreground
color is used. In this case cairo will call the render function
whenever the foreground color has changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CoreText uses different advances depending on the font size, with very
small point sizes sometimes getting advances that are smaller than the
glyph's width. This is manifested in the Apple Color Emoji font with the
Emoji glyphs having a width of 1.25 and an advance width of 1.0. That
results in overlapping emoji when they're in a string.
The small spacing difference also affects 3 tests so updated reference
images are included in this commit.
# Please enter the commit message for your changes. Lines starting
|
| |
|
| |
|
| |
|
|
|
|
| |
Allows removal of most conditional compilation and dlsym lookups.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
COLR fonts can have a layer with the same color as the current text
color. This change passes the current color (if solid) through to
the font backend where it can be used to render color fonts.
scaled_glyph_lookup checks if the foreground color has changed (for
glyph that require it) and requests a new color surface if required.
This also fixes a bug where scaled_glyph_lookup would always request a
color surface for glyphs for glyphs in color fonts that do not have
color.
|
|
|
|
|
|
|
|
|
|
| |
_cairo_malloc(0) always returns NULL, but has not been used
consistently. This patch replaces many calls to malloc() with
_cairo_malloc().
Fixes: fdo# 101547
CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
| |
The index 0 is a legitimate index used for character codes that do not
correspond to any glyph in the font. Instead, the API reserves 0xFFFF
(kCGFontIndexInvalid) as the invalid index and defines 0xFFFE
(kCGFontIndexMax = kCGGlyphMax) as the maximum legal index.
Fixes text-glyph-range.
|
|
|
|
|
|
|
|
|
|
| |
Truncating the UCS4 representation to 16 bits only works for the Basic
Multilingual Plane, the other characters must be translated to a
surrogate pair.
Fixes smp-glyph.
Reported-by: Clerk Ma <clerkma@gmail.com>
|
|
|
|
|
|
|
|
| |
The code for extracting font glyphs was replaced in
70cc8f250b5669e757b4f044571ba0f71e3dea9e with an implementation based
on CoreText, which is not available on MacOSX 10.4. This commit
restores automatic detection of which API should be used by means of
dynamic linking.
|
|
|
|
|
|
|
|
|
|
| |
An earlier fix to bug 84324 added a regression in the font size of
canvas text in Inkscape when compiled with the Quartz backend.
Patch from Andrea Canciani
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84324
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
|
|
|
|
|
|
|
|
|
|
| |
CGFontGetGlyphPath was not public and is not available anymore on
modern OSX/iOS systems. The same functionality is available through
the CoreText API since OSX 10.5.
Based on a patch by Simon Cozens.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=84324
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to close a race between locking the backend and resurrecting a
font via the cache, we need to keep the font face alive until after we
take the backend lock. Once we have that lock, we can drop our reference
and test if that was the last. Otherwise we must abort the destroy().
This fixes the double-free exposed by multithreaded applications trying
to create and destroy the same font concurrently.
Reported-by: Weeble <clockworksaint@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69470
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following Python script was used to compute "Since: 1.X" tags,
based on the first version where a symbol became officially supported.
This script requires a concatenation of the the cairo public headers
for the officially supported beckends to be available as
"../../includes/1.X.0.h".
from sys import argv
import re
syms = {}
def stripcomments(text):
def replacer(match):
s = match.group(0)
if s.startswith('/'):
return ""
else:
return s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)
for minor in range(12,-2,-2):
version = "1.%d" % minor
names = re.split('([A-Za-z0-9_]+)', stripcomments(open("../../includes/%s.0.h" % version).read()))
for s in names: syms[s] = version
for filename in argv[1:]:
is_public = False
lines = open(filename, "r").read().split("\n")
newlines = []
for i in range(len(lines)):
if lines[i] == "/**":
last_sym = lines[i+1][2:].strip().replace(":", "")
is_public = last_sym.lower().startswith("cairo")
elif is_public and lines[i] == " **/":
if last_sym in syms:
v = syms[last_sym]
if re.search("Since", newlines[-1]): newlines = newlines[:-1]
if newlines[-1].strip() != "*": newlines.append(" *")
newlines.append(" * Since: %s" % v)
else:
print "%s (%d): Cannot determine the version in which '%s' was introduced" % (filename, i, last_sym)
newlines.append(lines[i])
out = open(filename, "w")
out.write("\n".join(newlines))
out.close()
|
|
|
|
|
| |
This makes the documentations comments more consistent and fixes many
reports of 'invalid doc id'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Documentation comments should always start with "/**" and end with
"**/". This is not required by gtk-doc, but it makes the
documentations formatting more consistent and simplifies the checking
of documentation comments.
The following Python script tries to enforce this.
from sys import argv
from sre import search
for filename in argv[1:]:
in_doc = False
lines = open(filename, "r").read().split("\n")
for i in range(len(lines)):
ls = lines[i].strip()
if ls == "/**":
in_doc = True
elif in_doc and ls == "*/":
lines[i] = " **/"
if ls.endswith("*/"):
in_doc = False
out = open(filename, "w")
out.write("\n".join(lines))
out.close()
This fixes most 'documentation comment not closed with **/' warnings
by check-doc-syntax.awk.
|
|
|
|
|
|
|
|
|
|
|
|
| |
FMGetATSFontRefFromFont() is not public on Lion nor on 64-bits
Frameworks, but it seems to be available in the dynamic libs, hence we
can dlsym() it just like other private functions.
Works around the error:
cairo-quartz-font.c: In function 'cairo_quartz_font_face_create_for_atsu_font_id':
cairo-quartz-font.c:830: error: implicit declaration of function 'FMGetATSFontRefFromFont'
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=39493
|
|
|
|
|
|
|
|
|
|
| |
In af9fbd176b145f042408ef5391eef2a51d7531f8 the show_glyphs hook has
been removed from cairo_scaled_backend_t, but quartz-font was not
updated.
Fixes:
cairo-quartz-font.c:798: warning: initialization from incompatible pointer type
|
|
|
|
|
|
|
| |
cairo-image-surface-private.h is needed in order to access
cairo_image_surface_t fields.
Fixes multiple build errors: dereferencing pointer to incomplete type
|
|
|
|
|
|
|
|
|
|
|
| |
The existing API only described the method to be used for performing
rasterisation and unlike other API provided no opportunity for the user
to give a hint as to how to trade off performance against speed. So in
order to no be overly prescriptive, we extend the NONE/GRAY/SUBPIXEL
methods with FAST/GOOD/BEST hints and leave the backend to decide how
best to achieve those goals.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
|
|
| |
x_scale and y_scale are computed but never used.
|
|
|
|
|
|
| |
fb0304e2a9c99fa00e68bf4b37074a6885f19cff changed and specified the
behavior of load_truetype_table.
This commit makes quartz-font implement the new behavior.
|
|
|
|
| |
CFData is allocated and thus needs to be freed.
|
|
|
|
| |
Improves the quality of embedded fonts.
|
|
|
|
|
| |
A missing empty line caused the long description to be part of
@See_Also. Ooops.
|
|
|
|
|
|
| |
I did this manually so I could review the docs at the same time.
If anyone finds typos or other mistakes I did, please complain to me (or
better: fix them).
|
|
|
|
|
|
| |
glyph_path was taking into account the translation (which currently
is already applied in gstate) and the sign of the elements of the
matrices was not explained.
|
|
|
|
|
| |
Remove an unused function, explicitly ignore or check return values,
don't define unused variables.
|
|
|
|
|
|
|
|
|
| |
Silence Quartz complaints about operations on empty contexts:
<Error>: CGContextSetFont: invalid context 0x0
<Error>: CGContextSetFontSize: invalid context 0x0
<Error>: CGContextSetTextMatrix: invalid context 0x0
<Error>: CGContextSetAlpha: invalid context 0x0
<Error>: CGContextShowGlyphsAtPoint: invalid context 0x0
|
|
|
|
|
| |
A8 surfaces are now kAlphaOnly surfaces in quartz-font too.
Subpixel font smoothing can be enabled.
|
|
|
|
|
|
|
|
|
| |
glyphs in Al Bayan font
This resolves the problem by checking for the crazy glyph bbox result from
CoreGraphics, and replacing it with an empty rect.
From https://bugzilla.mozilla.org/show_bug.cgi?id=534260
|
|
|
|
|
|
| |
Corporation"
From https://bugzilla.mozilla.org/show_bug.cgi?id=507387
|
|
|
|
|
|
|
|
|
|
|
| |
I updated the Free Software Foundation address using the following script.
for i in $(git grep Temple | cut -d: -f1 )
do
sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
|
|
|
|
|
| |
A pending commit will want to include some utility code from cairo and
so we need to extricate the error handling from the PLT symbol hiding.
|
|
|
|
|
|
| |
As the associated is now explicitly the font-face used to create the font
by the user, whereas what we require is the current implementation
(quartz) font.
|
|
|
|
|
| |
OS X doesn't support ATSUI in 64 bit so don't include the cairo ATSUI
API in that case.
|
|
|
|
|
|
|
| |
Fixes a memory leak should we bail due to the version of Quartz being
insufficient.
Reported: http://bugs.freedesktop.org/show_bug.cgi?id=19209.
|
|
|
|
|
| |
Removes the NULL so that _cairo_quartz_font_face_scaled_font_create
is in the correct location.
|
|
|
|
|
| |
Declares _cairo_quartz_scaled_font_backend ahead of time and makes it static.
Also, removes the 'static' from the _cairo_quartz_font_backend definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit moves the toy-to-real mapping from the scaled font creation
time to font face creation. A toy font face will keep an internal ref
to an implementation face. Then cairo_scaled_font_create() will simply
substitute the implementation face before creating anything.
This also modifies the cairo-ft toy creation in that we now create a
non-resolved pattern and store it in a cairo-ft font-face. We then
do the resolving and unscaled font creation at scaled-font creation
time. This also means that cairo_ft_font_face_create_for_pattern()
now accepts non-resolved patterns too, and does the right thing about
them. As much as that can be called right.
Some testing of toy font creation performance is in order, as is testing
win32 and quartz font backends.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quartz fonts and user fonts use an indirect font face when creating a
scaled font for the toy font face. This means that they insert a scaled
font into the font map that has a different font face to the one that is
initially searched upon. The result is that when we try to create an
identical scaled font, we fail to find the existing scaled font and
attempt to insert a duplicate into the hash table - which triggers an
assert.
In order to avoid creating duplicate fonts, we add a new method to the
font backends that allows cairo_scaled_font_create() to peek at the
font_face that will be used to actually implement the scaled font
constructor - thus we are able to use the correct font_face as part of the
hash key.
|
|
|
|
| |
_cairo_matrix_compute_basis_scale_factors
|
|
|
|
| |
Seems to happen on 10.4 only for unknown reasons. Protect against a crash at least.
|
| |
|
| |
|
|
|
|
|
| |
The toy font constructor and the _with_atsu_font_id constructor were
not properly managing the refcount of the CGFontRef.
|
| |
|
| |
|
|
|
|
|
|
| |
Forgetting to include cairoint.h (or not including it first) can
cause some subtle bugs due to specific feature flags not being
set, etc.
|