diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2014-07-28 18:37:36 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-04-04 16:13:40 -0700 |
commit | 7d30b3f91958a3ff45ee2b8e5de2b6186cadfb72 (patch) | |
tree | c598289612344faffb3b0225707f1c2ed2282de8 /pango/pangofc-shape.c | |
parent | 14c11dd96e1547aaede1bb05a0243f5b0b53186e (diff) | |
download | pango-7d30b3f91958a3ff45ee2b8e5de2b6186cadfb72.tar.gz |
Deprecate module system, skip it for shaper modules
Now shaper is discovered via (previously unused!) font->find_shaper().
I'm keeping that just to allow clients override shaping. Though,
even that I'm not sure we want to keep.
Wraps shaper in PangoEngineShape structs to keep PangoAnalysis API
intact.
Deprecated pango-modules.h and some pango-engine.h. Language modules
are not moved yet.
Wired up PangoFc, PangoWin32, and PangoCoretext shapers.
Diffstat (limited to 'pango/pangofc-shape.c')
-rw-r--r-- | pango/pangofc-shape.c | 85 |
1 files changed, 10 insertions, 75 deletions
diff --git a/pango/pangofc-shape.c b/pango/pangofc-shape.c index d77dacef..8db471a6 100644 --- a/pango/pangofc-shape.c +++ b/pango/pangofc-shape.c @@ -1,5 +1,5 @@ /* Pango - * basic-fc.c: Basic shaper for FreeType-based backends + * pangofc-shape.c: Basic shaper for FreeType-based backends * * Copyright (C) 2000, 2007, 2009 Red Hat Software * Authors: @@ -27,37 +27,12 @@ #define PANGO_ENABLE_BACKEND 1 /* XXX */ -#include "pango-engine.h" -#include "pango-utils.h" -#include "pangofc-fontmap.h" -#include "pangofc-font.h" +#include "pangofc-private.h" #include <hb-ft.h> #include <hb-glib.h> #define PANGO_UNITS_26_6(d) ((d) << 4) - -/* No extra fields needed */ -typedef PangoEngineShape BasicEngineFc; -typedef PangoEngineShapeClass BasicEngineFcClass; - -#define SCRIPT_ENGINE_NAME "BasicScriptEngineFc" -#define RENDER_TYPE PANGO_RENDER_TYPE_FC - -static PangoEngineScriptInfo basic_scripts[] = { - { PANGO_SCRIPT_COMMON, "" } -}; - -static PangoEngineInfo script_engines[] = { - { - SCRIPT_ENGINE_NAME, - PANGO_ENGINE_TYPE_SHAPE, - RENDER_TYPE, - basic_scripts, G_N_ELEMENTS(basic_scripts) - } -}; - - /* cache a single hb_buffer_t */ static hb_buffer_t *cached_buffer = NULL; /* MT-safe */ G_LOCK_DEFINE_STATIC (cached_buffer); @@ -299,17 +274,14 @@ pango_fc_get_hb_font_funcs (void) } - - -static void -basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, - PangoFont *font, - const char *item_text, - unsigned int item_length, - const PangoAnalysis *analysis, - PangoGlyphString *glyphs, - const char *paragraph_text, - unsigned int paragraph_length) +void +_pango_fc_shape (PangoFont *font, + const char *item_text, + unsigned int item_length, + const PangoAnalysis *analysis, + PangoGlyphString *glyphs, + const char *paragraph_text, + unsigned int paragraph_length) { PangoFcHbContext context; PangoFcFont *fc_font; @@ -444,40 +416,3 @@ basic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED, hb_face_destroy (hb_face); pango_fc_font_unlock_face (fc_font); } - -static void -basic_engine_fc_class_init (PangoEngineShapeClass *class) -{ - class->script_shape = basic_engine_shape; -} - -PANGO_ENGINE_SHAPE_DEFINE_TYPE (BasicEngineFc, basic_engine_fc, - basic_engine_fc_class_init, NULL) - -void -PANGO_MODULE_ENTRY(init) (GTypeModule *module) -{ - basic_engine_fc_register_type (module); -} - -void -PANGO_MODULE_ENTRY(exit) (void) -{ -} - -void -PANGO_MODULE_ENTRY(list) (PangoEngineInfo **engines, - int *n_engines) -{ - *engines = script_engines; - *n_engines = G_N_ELEMENTS (script_engines); -} - -PangoEngine * -PANGO_MODULE_ENTRY(create) (const char *id) -{ - if (!strcmp (id, SCRIPT_ENGINE_NAME)) - return g_object_new (basic_engine_fc_type, NULL); - else - return NULL; -} |