[cairo-commit] src/win32
Chris Wilson
ickle at kemper.freedesktop.org
Sun Oct 6 01:58:33 PDT 2013
src/win32/cairo-win32-font.c | 90 ++++++++++++++++++++-----------------------
1 file changed, 43 insertions(+), 47 deletions(-)
New commits:
commit f1eefee985b4361386a167e80d9836593ade59b9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Sun Oct 6 09:57:44 2013 +0100
win32: Reorder font declarations to be in natural order
Reported-by: John Emmas <johne53 at tiscali.co.uk>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/win32/cairo-win32-font.c b/src/win32/cairo-win32-font.c
index 5ec2c2c..1599b07 100644
--- a/src/win32/cairo-win32-font.c
+++ b/src/win32/cairo-win32-font.c
@@ -157,10 +157,6 @@ static cairo_status_t
_cairo_win32_scaled_font_init_glyph_path (cairo_win32_scaled_font_t *scaled_font,
cairo_scaled_glyph_t *scaled_glyph);
-static void
-_cairo_win32_font_face_destroy (void *abstract_face);
-
-
#define NEARLY_ZERO(d) (fabs(d) < (1. / 65536.))
static HDC
@@ -1847,49 +1843,6 @@ struct _cairo_win32_font_face {
HFONT hfont;
};
-/* implement the platform-specific interface */
-
-static cairo_bool_t
-_is_scale (const cairo_matrix_t *matrix, double scale)
-{
- return matrix->xx == scale && matrix->yy == scale &&
- matrix->xy == 0. && matrix->yx == 0. &&
- matrix->x0 == 0. && matrix->y0 == 0.;
-}
-
-static cairo_status_t
-_cairo_win32_font_face_scaled_font_create (void *abstract_face,
- const cairo_matrix_t *font_matrix,
- const cairo_matrix_t *ctm,
- const cairo_font_options_t *options,
- cairo_scaled_font_t **font)
-{
- HFONT hfont = NULL;
-
- cairo_win32_font_face_t *font_face = abstract_face;
-
- if (font_face->hfont) {
- /* Check whether it's OK to go ahead and use the font-face's HFONT. */
- if (_is_scale (ctm, 1.) &&
- _is_scale (font_matrix, -font_face->logfont.lfHeight)) {
- hfont = font_face->hfont;
- }
- }
-
- return _win32_scaled_font_create (&font_face->logfont,
- hfont,
- &font_face->base,
- font_matrix, ctm, options,
- font);
-}
-
-const cairo_font_face_backend_t _cairo_win32_font_face_backend = {
- CAIRO_FONT_TYPE_WIN32,
- _cairo_win32_font_face_create_for_toy,
- _cairo_win32_font_face_destroy,
- _cairo_win32_font_face_scaled_font_create
-};
-
/* We maintain a hash table from LOGFONT,HFONT => #cairo_font_face_t.
* The primary purpose of this mapping is to provide unique
* #cairo_font_face_t values so that our cache and mapping from
@@ -2016,6 +1969,49 @@ _cairo_win32_font_face_keys_equal (const void *key_a,
return FALSE;
}
+/* implement the platform-specific interface */
+
+static cairo_bool_t
+_is_scale (const cairo_matrix_t *matrix, double scale)
+{
+ return matrix->xx == scale && matrix->yy == scale &&
+ matrix->xy == 0. && matrix->yx == 0. &&
+ matrix->x0 == 0. && matrix->y0 == 0.;
+}
+
+static cairo_status_t
+_cairo_win32_font_face_scaled_font_create (void *abstract_face,
+ const cairo_matrix_t *font_matrix,
+ const cairo_matrix_t *ctm,
+ const cairo_font_options_t *options,
+ cairo_scaled_font_t **font)
+{
+ HFONT hfont = NULL;
+
+ cairo_win32_font_face_t *font_face = abstract_face;
+
+ if (font_face->hfont) {
+ /* Check whether it's OK to go ahead and use the font-face's HFONT. */
+ if (_is_scale (ctm, 1.) &&
+ _is_scale (font_matrix, -font_face->logfont.lfHeight)) {
+ hfont = font_face->hfont;
+ }
+ }
+
+ return _win32_scaled_font_create (&font_face->logfont,
+ hfont,
+ &font_face->base,
+ font_matrix, ctm, options,
+ font);
+}
+
+const cairo_font_face_backend_t _cairo_win32_font_face_backend = {
+ CAIRO_FONT_TYPE_WIN32,
+ _cairo_win32_font_face_create_for_toy,
+ _cairo_win32_font_face_destroy,
+ _cairo_win32_font_face_scaled_font_create
+};
+
/**
* cairo_win32_font_face_create_for_logfontw_hfont:
* @logfont: A #LOGFONTW structure specifying the font to use.
More information about the cairo-commit
mailing list