summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-05-08 16:43:43 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-05-15 21:31:01 +0100
commitd6f6ec9082c86b9fd9e2389b9627f08a91c2cdd3 (patch)
tree4077a86a1f75e9a9554a00ad1af5025065ada9d8 /src
parenta352fd46020e18f9d9f839f0c3f3a63c1d8c0ae1 (diff)
[ft] Restore the ability to lazily resolve patterns.
I broke the ability for the ft font backend to resolve patterns whilst fixing the font creation to propagate the error status from fontconfig (be27e8). By adjusting the sequence of error checks we do not confuse the absence of a match with a fatal error and thereby restoring the lazy pattern resolution whilst ensuring error propagation.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-ft-font.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index e701c213..1e2a18ee 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -482,24 +482,26 @@ _cairo_ft_unscaled_font_create_for_pattern (FcPattern *pattern,
FcResult ret;
ret = FcPatternGetFTFace (pattern, FC_FT_FACE, 0, &font_face);
- switch ((int) ret) {
- case FcResultMatch:
+ if (ret == FcResultMatch)
+ goto DONE;
+ if (ret == FcResultOutOfMemory)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+
+ ret = FcPatternGetString (pattern, FC_FILE, 0, (FcChar8 **) &filename);
+ if (ret == FcResultOutOfMemory)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ if (ret == FcResultMatch) {
+ /* If FC_INDEX is not set, we just use 0 */
+ ret = FcPatternGetInteger (pattern, FC_INDEX, 0, &id);
+ if (ret == FcResultOutOfMemory)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+
goto DONE;
- case FcResultOutOfMemory:
- break;
- default:
- if (FcPatternGetString (pattern, FC_FILE, 0,
- (FcChar8 **) &filename) == FcResultMatch)
- {
- /* If FC_INDEX is not set, we just use 0 */
- if (FcPatternGetInteger (pattern,
- FC_INDEX, 0, &id) != FcResultOutOfMemory)
- goto DONE;
- }
- break;
}
- return _cairo_error (CAIRO_STATUS_NO_MEMORY);
+ /* The pattern contains neither a face nor a filename, resolve it later. */
+ *out = NULL;
+ return CAIRO_STATUS_SUCCESS;
DONE:
return _cairo_ft_unscaled_font_create_internal (font_face != NULL,
reoffice-4-0-4'>libreoffice-4-0-4 Unnamed repository; edit this file to name it for gitweb.root
summaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2012-11-21Slovenian update for 3.6.4suse-3.6-9suse-3.6-8suse-3.6-7suse-3.6-6suse-3.6-5suse-3.6-32suse-3.6-31suse-3.6-30suse-3.6-29suse-3.6-28suse-3.6-27suse-3.6-26suse-3.6-25suse-3.6-24suse-3.6-23suse-3.6-22suse-3.6-21suse-3.6-20suse-3.6-19suse-3.6-18suse-3.6-17suse-3.6-16suse-3.6-14suse-3.6-13suse-3.6-12suse-3.6-11suse-3.6-10distro/suse/suse-3.6Andras Timar2-2983/+3085
2012-11-21update translations for LibreOffice 3.6.4 rc1Andras Timar760-51242/+243138
2012-11-06update translations for LibreOffice 3.6.3 rc2Andras Timar211-6980/+6886
2012-11-06update translations for LibreOffice 3.6.3 rc1Andras Timar608-47040/+58239
2012-09-27Branch suse-3.6suse-3.6-0Tor Lillqvist0-0/+0
2012-09-25Version 3.6.2.2, tag libreoffice-3.6.2.2libreoffice-3.6.2.2Fridrich Štrba0-0/+0
2012-09-24update translations for LibreOffice 3.6.2 rc2libreoffice-3-6-2Andras Timar542-3842/+3526
2012-09-11Branch libreoffice-3-6-2Petr Mladek0-0/+0
2012-09-10update translations for LibreOffice 3.6.2 rc1Andras Timar2809-174444/+172004
2012-08-20update translations for LibreOffice 3.6.1 rc2 (2nd)Andras Timar122-1559/+1341
2012-08-17update translations for LibreOffice 3.6.1 rc2Andras Timar682-9614/+8472
2012-08-12update translations for LibreOffice 3.6.1 rc1Andras Timar2271-49193/+34309
2012-07-16update translations for LibreOffice 3.6.0 rc2Andras Timar28967-40461/+41581
2012-07-10update translations for LibreOffice 3.6.0 rc1Andras Timar3442-38376/+28548
2012-07-01update translations for LibreOffice 3.6.0 beta3Andras Timar31979-255559/+265788
2012-06-18update Serbian translation for 3.6.0 beta2Andras Timar558-69908/+71082
2012-06-18update translations for LibreOffice 3.6.0 beta2Andras Timar