summaryrefslogtreecommitdiff
path: root/src/cairo-quartz-font.c
AgeCommit message (Collapse)AuthorFilesLines
2015-04-24Fix broken canvas text font size in InkscapeBryce Harrington1-1/+1
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>
2015-02-05quartz: Remove call to obsolete CGFontGetGlyphPathAndrea Canciani1-6/+4
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
2013-09-17font: Push the last reference dec into the backend->destroy() callbackChris Wilson1-1/+2
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>
2012-03-29doc: Add "since" tag to documentationAndrea Canciani1-0/+2
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()
2012-03-29doc: Make doc ids more consistent my always putting ':' after themAndrea Canciani1-2/+2
This makes the documentations comments more consistent and fixes many reports of 'invalid doc id'.
2012-03-29doc: Make documentation comments symmetricAndrea Canciani1-3/+3
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.
2011-10-01quartz: Fix the 32-bits build on MacOSX 10.7Andrea Canciani1-8/+18
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
2011-09-18quartz-font: Fix scaled font backend hooksAndrea Canciani1-1/+0
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
2011-09-02quartz: Fix compilationAndrea Canciani1-0/+1
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
2011-08-30api: Extend cairo_antialias_t to include performace/quality hintsChris Wilson1-0/+3
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>
2011-03-18quartz-font: Remove unused variablesAndrea Canciani1-12/+0
x_scale and y_scale are computed but never used.
2010-11-23quartz-font: Implement new load_truetype_table semanticsAndrea Canciani1-13/+10
fb0304e2a9c99fa00e68bf4b37074a6885f19cff changed and specified the behavior of load_truetype_table. This commit makes quartz-font implement the new behavior.
2010-11-01quartz-font: Do not leak CFDataRef'sAndrea Canciani1-0/+3
CFData is allocated and thus needs to be freed.
2010-11-01quartz-font: Add truetype font table tags accessorAndrea Canciani1-1/+38
Improves the quality of embedded fonts.
2010-07-09doc: Fix a syntax issue in quartz-font gtkdocBenjamin Otte1-0/+1
A missing empty line caused the long description to be part of @See_Also. Ooops.
2010-07-08doc: Move tmpl/ docs to inline docsBenjamin Otte1-0/+17
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).
2010-06-28quartz-font: correct and explain matrix computationsAndrea Canciani1-7/+6
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.
2010-06-28quartz-font: silence compiler warningsAndrea Canciani1-54/+30
Remove an unused function, explicitly ignore or check return values, don't define unused variables.
2010-05-17quartz-font: Silence 0x0 CGContext warningAndrea Canciani1-35/+42
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
2010-05-17quartz-font: Conform context and antialias handling to quartz-surfaceAndrea Canciani1-10/+28
A8 surfaces are now kAlphaOnly surfaces in quartz-font too. Subpixel font smoothing can be enabled.
2010-05-07quartz: Work around bad glyph extents returned by CoreGraphics for empty ↵Jonathan Kew1-0/+10
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
2010-05-06Update license blocks to use "Mozilla Foundation" instead of "Mozilla ↵Metal Sonic1-1/+1
Corporation" From https://bugzilla.mozilla.org/show_bug.cgi?id=507387
2010-04-27Update FSF addressAndrea Canciani1-1/+1
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
2010-01-22Move _cairo_error() to a standalone headerChris Wilson1-0/+2
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.
2009-08-10[quartz] Use the implementation font-face not the associatedChris Wilson1-4/+2
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.
2009-06-11Fix compilation on OS X when compiling for 64 bitJeff Muizelaar1-1/+2
OS X doesn't support ATSUI in 64 bit so don't include the cairo ATSUI API in that case.
2009-01-02[quartz] Delay allocation of string until after guard.Chris Wilson1-2/+4
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.
2008-12-19Fix definition of _cairo_quartz_font_face_backendJeff Muizelaar1-1/+0
Removes the NULL so that _cairo_quartz_font_face_scaled_font_create is in the correct location.
2008-12-19Fix compilation of quartz surface.Jeff Muizelaar1-2/+4
Declares _cairo_quartz_scaled_font_backend ahead of time and makes it static. Also, removes the 'static' from the _cairo_quartz_font_backend definition.
2008-12-17Clean up toy font face handlingBehdad Esfahbod1-130/+78
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.
2008-10-22Map toy font face to implementation.Chris Wilson1-11/+44
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.
2008-08-27Rename _cairo_matrix_compute_scale_factors to ↵Behdad Esfahbod1-3/+3
_cairo_matrix_compute_basis_scale_factors
2008-07-09[quartz] Protect against NULL from CGFontGetHMetricsPtrVladimir Vukicevic1-0/+6
Seems to happen on 10.4 only for unknown reasons. Protect against a crash at least.
2008-06-22Rename cairo_quartz_scaled_font_backend to _cairo_quartz_scaled_font_backendBehdad Esfahbod1-2/+2
2008-05-10Fix gtk-doc warningsBehdad Esfahbod1-6/+6
2008-04-27[quartz] Fix CGFont leaks when creating quartz fontsVladimir Vukicevic1-1/+8
The toy font constructor and the _with_atsu_font_id constructor were not properly managing the refcount of the CGFontRef.
2008-04-02[cgfont] typo fixVladimir Vukicevic1-1/+1
2008-04-02[cgfont] Implement missing scaled font metricsVladimir Vukicevic1-3/+71
2008-04-01Include cairoint.h first to satisfy the test suiteCarl Worth1-2/+2
Forgetting to include cairoint.h (or not including it first) can cause some subtle bugs due to specific feature flags not being set, etc.
2008-04-01[quartz] Update documentationVladimir Vukicevic1-2/+12
2008-04-01[cgfont] Round surface rectangle outwards to ensure whole-pixel dimensionsVladimir Vukicevic1-12/+48
2008-04-01[cgfont] Fix whitespace errorsVladimir Vukicevic1-2/+2
2008-04-01[cgfont] Add CGFont backend to replace deprecated ATSUI backendVladimir Vukicevic1-17/+107
Create a new font backend that uses the CGFont API on MacOS X 10.4 and beyond.
2008-04-01[cgfont] Add start of CGFont font backend to replace ATSUIVladimir Vukicevic1-0/+590