Commit 8168660e authored by Behdad Esfahbod's avatar Behdad Esfahbod
Browse files

Merge branch 'harfbuzz-ng-external'

Conflicts:
	configure.in
	docs/tmpl/text-attributes.sgml
	modules/arabic/arabic-ot.c
	modules/indic/indic-ot.c
	pango/opentype/Makefile.am
	pango/opentype/hb-blob.c
	pango/opentype/hb-buffer-private.h
	pango/opentype/hb-common.h
	pango/opentype/hb-ot-layout-gsubgpos-private.hh
	pango/opentype/hb-private.h
	pango/pango-ot-info.c
parents feff5a6e 656d473b
......@@ -35,7 +35,6 @@
<ClCompile Include="..\..\..\modules\thai\thai-fc.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\thai\thai-shaper.c"><Filter>Source Files</Filter></ClCompile>
<ClCompile Include="..\..\..\modules\tibetan\tibetan-fc.c"><Filter>Source Files</Filter></ClCompile>
#include "opentype/libharfbuzz.vs10.sourcefiles.filters"
#include "libpangoft2.vs10.sourcefiles.filters"
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -223,7 +223,6 @@
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release_FC|Win32'">PANGO_MODULE_PREFIX=_pango_tibetan_fc;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release_FC|x64'">PANGO_MODULE_PREFIX=_pango_tibetan_fc;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
#include "opentype/libharfbuzz.vs10.sourcefiles"
#include "libpangoft2.vs10.sourcefiles"
</ItemGroup>
<ItemGroup>
......
......@@ -230,7 +230,6 @@
<FileConfiguration Name="Debug_FC|x64"><Tool Name="VCCLCompilerTool" PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_tibetan_fc" /></FileConfiguration>
<FileConfiguration Name="Release_FC|x64"><Tool Name="VCCLCompilerTool" PreprocessorDefinitions="PANGO_MODULE_PREFIX=_pango_tibetan_fc" /></FileConfiguration>
</File>
#include "opentype/libharfbuzz.sourcefiles"
#include "libpangoft2.sourcefiles"
</Filter>
</Files>
......
......@@ -369,7 +369,7 @@ have_cairo_atsui=false
cairo_required=1.7.6
PKG_CHECK_MODULES(CAIRO, cairo >= $cairo_required, have_cairo=true, AC_MSG_RESULT([no]))
if $have_cairo ; then
pango_save_libs=$LIBS
LIBS="$LIBS $CAIRO_LIBS"
......@@ -451,6 +451,12 @@ AM_CONDITIONAL(HAVE_CAIRO_WIN32, $have_cairo_win32)
AM_CONDITIONAL(HAVE_CAIRO_FREETYPE, $have_cairo_freetype)
AM_CONDITIONAL(HAVE_CAIRO_ATSUI, $have_cairo_atsui)
harfbuzz_required=0.9
have_harfbuzz=false
PKG_CHECK_MODULES(HARFBUZZ, harfbuzz >= $harfbuzz_required, have_harfbuzz=true)
AM_CONDITIONAL(HAVE_HARFBUZZ, $have_harfbuzz)
#
# We must have some backend defined, in order for the pango-querymodules
# rule in pango/Makefile.am to work correctly. If you are up to writing
......@@ -485,9 +491,8 @@ GLIB_CFLAGS=`$PKG_CONFIG --cflags $GLIB_MODULES gthread-2.0`
#
# Checks for LibThai
#
have_libthai=false
LIBTHAI_REQUIRED_VERSION=0.1.9
PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=true, :)
PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=true, have_libthai=false)
#
# Checks for GObject Introspection
......@@ -498,21 +503,16 @@ GOBJECT_INTROSPECTION_CHECK([0.9.5])
#
# Modules to build
#
arabic_modules="arabic-fc,arabic-lang"
arabic_modules="arabic-lang"
basic_modules="basic-fc,basic-win32,basic-x,basic-atsui,basic-coretext"
hangul_modules="hangul-fc"
hebrew_modules="hebrew-fc"
indic_modules="indic-fc,indic-lang"
khmer_modules="khmer-fc"
syriac_modules="syriac-fc"
thai_modules="thai-fc"
tibetan_modules="tibetan-fc"
indic_modules="indic-lang"
thai_modules=""
if $have_libthai ; then
thai_modules="$thai_modules,thai-lang"
fi
all_modules="$arabic_modules,$basic_modules,$hangul_modules,$hebrew_modules,$indic_modules,$khmer_modules,$syriac_modules,$thai_modules,$tibetan_modules"
all_modules="$arabic_modules,$basic_modules,$indic_modules,$thai_modules"
#
# Allow building some or all modules included
......@@ -567,10 +567,7 @@ AC_SUBST(INCLUDED_LANG_MODULES)
IFS="${IFS= }"; pango_save_ifs="$IFS"; IFS=", "
for module in $included_modules; do
case $indic_modules in
*$module*) dir=indic ;;
*) dir=`echo $module | sed "s/-.*//"` ;;
esac
dir=`echo $module | sed "s/-.*//"`
included_path="\$(top_builddir)/modules/$dir/libpango-$module.la"
case $module in
......@@ -585,39 +582,23 @@ for module in $included_modules; do
done
IFS="$pango_save_ifs"
AM_CONDITIONAL(INCLUDE_ARABIC_FC, echo $included_modules | egrep '(^|,)arabic-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_ARABIC_LANG, echo $included_modules | egrep '(^|,)arabic-lang($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_BASIC_FC, echo $included_modules | egrep '(^|,)basic-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_BASIC_WIN32, echo $included_modules | egrep '(^|,)basic-win32($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_BASIC_X, echo $included_modules | egrep '(^|,)basic-x($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_BASIC_ATSUI, echo $included_modules | egrep '(^|,)basic-atsui($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_BASIC_CORE_TEXT, echo $included_modules | egrep '(^|,)basic-coretext($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_HANGUL_FC, echo $included_modules | egrep '(^|,)hangul-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_HEBREW_FC, echo $included_modules | egrep '(^|,)hebrew-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_INDIC_FC, echo $included_modules | egrep '(^|,)indic-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_INDIC_LANG, echo $included_modules | egrep '(^|,)indic-lang($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_KHMER_FC, echo $included_modules | egrep '(^|,)khmer-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_SYRIAC_FC, echo $included_modules | egrep '(^|,)syriac-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_THAI_FC, echo $included_modules | egrep '(^|,)thai-fc($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_THAI_LANG, echo $included_modules | egrep '(^|,)thai-lang($|,)' > /dev/null)
AM_CONDITIONAL(INCLUDE_TIBETAN_FC, echo $included_modules | egrep '(^|,)tibetan-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_ARABIC_FC, echo $dynamic_modules | egrep '(^|,)arabic-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_ARABIC_LANG, echo $dynamic_modules | egrep '(^|,)arabic-lang($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_BASIC_FC, echo $dynamic_modules | egrep '(^|,)basic-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_BASIC_WIN32, echo $dynamic_modules | egrep '(^|,)basic-win32($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_BASIC_X, echo $dynamic_modules | egrep '(^|,)basic-x($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_BASIC_ATSUI, echo $dynamic_modules | egrep '(^|,)basic-atsui($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_BASIC_CORE_TEXT, echo $dynamic_modules | egrep '(^|,)basic-coretext($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_HANGUL_FC, echo $dynamic_modules | egrep '(^|,)hangul-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_HEBREW_FC, echo $dynamic_modules | egrep '(^|,)hebrew-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_INDIC_FC, echo $dynamic_modules | egrep '(^|,)indic-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_INDIC_LANG, echo $dynamic_modules | egrep '(^|,)indic-lang($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_KHMER_FC, echo $dynamic_modules | egrep '(^|,)khmer-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_SYRIAC_FC, echo $dynamic_modules | egrep '(^|,)syriac-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_THAI_FC, echo $dynamic_modules | egrep '(^|,)thai-fc($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_THAI_LANG, echo $dynamic_modules | egrep '(^|,)thai-lang($|,)' > /dev/null)
AM_CONDITIONAL(DYNAMIC_TIBETAN_FC, echo $dynamic_modules | egrep '(^|,)tibetan-fc($|,)' > /dev/null)
#
# We use flockfile to implement pango_getline() - should be moved to GLib
......@@ -683,7 +664,7 @@ dnl * Options to pass to libtool
dnl ********************************************************
# Note that -module isn't included here since automake needs to see it to know
# that something like pango-arabic-fc.la is a valid libtool archive
# that something like pango-basic-fc.la is a valid libtool archive
#
LIBRARY_LIBTOOL_OPTIONS="-version-info $VERSION_INFO"
MODULE_LIBTOOL_OPTIONS="-export-dynamic -avoid-version"
......@@ -1005,7 +986,6 @@ AC_CONFIG_FILES([
Makefile
pango/Makefile
pango/mini-fribidi/Makefile
pango/opentype/Makefile
pango/pango.rc
pango/pangoft2.rc
pango/pangowin32.rc
......@@ -1016,13 +996,8 @@ pango-view/Makefile
modules/Makefile
modules/arabic/Makefile
modules/basic/Makefile
modules/hangul/Makefile
modules/hebrew/Makefile
modules/indic/Makefile
modules/khmer/Makefile
modules/syriac/Makefile
modules/thai/Makefile
modules/tibetan/Makefile
examples/Makefile
docs/Makefile
docs/version.xml
......
......@@ -23,8 +23,7 @@ MacOS systems using the ATSUI text rendering subsystem.
<!-- ##### MACRO PANGO_RENDER_TYPE_ATSUI ##### -->
<para>
A string constant identifying the ATSUI renderer. The associated quark (see
g_quark_from_string()) is used to identify the renderer in pango_find_map().
</para>
......
......@@ -442,24 +442,15 @@ the documentation of the corresponding getters for documentation
of their meaning.
</para>
@ref_count: reference count. Used internally. See pango_font_metrics_ref()
and pango_font_metrics_unref().
@ascent: the distance from the baseline to the highest point of the glyphs of
the font. This is positive in practically all fonts.
@descent: the distance from the baseline to the lowest point of the glyphs of
the font. This is positive in practically all fonts.
@approximate_char_width: approximate average width of the regular glyphs of
the font. Note that for this calculation, East Asian characters
(those passing g_unichar_iswide()) are counted as double-width.
This produces a more uniform value for this measure across languages
and results in more uniform and more expected UI sizes.
@approximate_digit_width: approximate average width of the glyphs for digits
of the font.
@underline_position: position of the underline. This is normally negative.
@underline_thickness: thickness of the underline.
@strikethrough_position: position of the strikethrough line. This is
normally positive.
@strikethrough_thickness: thickness of the strikethrough line.
@ref_count:
@ascent:
@descent:
@approximate_char_width:
@approximate_digit_width:
@underline_position:
@underline_thickness:
@strikethrough_position:
@strikethrough_thickness:
<!-- ##### MACRO PANGO_TYPE_FONT_METRICS ##### -->
<para>
......@@ -984,7 +975,7 @@ a particular #PangoFontset implementation.
@fontset:
@font:
@data:
@user_data:
@Returns:
......
......@@ -395,11 +395,9 @@ The storage for the glyph information is owned
by the structure which simplifies memory management.
</para>
@num_glyphs: the number of glyphs in the string.
@glyphs: an array of #PangoGlyphInfo structures of length <structfield>num_glyphs</structfield>.
@log_clusters: for each glyph, byte index of the starting character for the
cluster. The indices are relative to the start of the text
corresponding to the PangoGlyphString.
@num_glyphs:
@glyphs:
@log_clusters:
<!-- ##### STRUCT PangoGlyphItem ##### -->
<para>
......@@ -410,10 +408,8 @@ of shaping text with #PangoLayout is a list of #PangoLayoutLine,
each of which contains a list of #PangoGlyphItem.
</para>
@item: a #PangoItem structure that provides information
about a segment of text.
@glyphs: the glyphs obtained by shaping the text
corresponding to @item.
@item:
@glyphs:
<!-- ##### STRUCT PangoGlyphItemIter ##### -->
<para>
......@@ -457,14 +453,14 @@ None of the members of a #PangoGlyphItemIter should be modified manually.
</para>
@glyph_item: the #PangoGlyphItem this iterator iterates over
@text: the UTF-8 text that @glyph_item refers to
@start_glyph: starting glyph of the cluster
@start_index: starting text index of the cluster
@start_char: starting number of characters of the cluster
@end_glyph: ending glyph of the cluster
@end_index: ending text index of the cluster
@end_char: ending number of characters of the cluster
@glyph_item:
@text:
@start_glyph:
@start_index:
@start_char:
@end_glyph:
@end_index:
@end_char:
@Since: 1.22
<!-- ##### MACRO PANGO_TYPE_GLYPH_STRING ##### -->
......
......@@ -124,8 +124,8 @@ has no user-visible fields.
</para>
@layout:
@Returns:
@layout:
@Returns:
<!-- ##### FUNCTION pango_layout_set_markup ##### -->
......@@ -478,9 +478,9 @@ The #GObject type for #PangoAlignment.
</para>
@layout:
@n_attrs:
@Returns:
@layout:
@n_attrs:
@Returns:
<!-- ##### FUNCTION pango_layout_index_to_pos ##### -->
......@@ -845,12 +845,12 @@ Routines for rendering PangoLayout objects are provided in
code specific to each rendering system.
</para>
@layout: the parent layout for this line
@start_index: the start of the line as byte index into @layout->text
@length: the length of the line in bytes
@runs: a list containing the runs of the line in visual order
@is_paragraph_start: %TRUE if this is the first line of the paragraph
@resolved_dir: the resolved #PangoDirection of the line
@layout:
@start_index:
@length:
@runs:
@is_paragraph_start:
@resolved_dir:
<!-- ##### TYPEDEF PangoLayoutRun ##### -->
<para>
......
......@@ -36,11 +36,10 @@ The #PangoItem structure stores information about
a segment of text. It contains the following fields:
</para>
@offset: the offset of the segment from the beginning of the
string in bytes.
@length: the length of the segment in bytes.
@num_chars: the length of the segment in characters.
@analysis: the properties of the segment.
@offset:
@length:
@num_chars:
@analysis:
<!-- ##### STRUCT PangoAnalysis ##### -->
<para>
......
......@@ -465,8 +465,10 @@ A copy function passed to attribute new functions that take
user data.
</para>
@data: the user data
@user_data:
@Returns: a new copy of @data.
<!-- # Unused Parameters # -->
@data: the user data
<!-- ##### FUNCTION pango_attr_scale_new ##### -->
......@@ -578,10 +580,9 @@ The #PangoColor structure is used to
represent a color in an uncalibrated RGB color-space.
</para>
@red: the red component of the color. This is a value between 0 and
65535, with 65535 indicating full intensity
@green: the green component of the color
@blue: the blue component of the color
@red:
@green:
@blue:
<!-- ##### MACRO PANGO_TYPE_COLOR ##### -->
<para>
......@@ -740,8 +741,10 @@ to filter out a subset of attributes for a list.
</para>
@attribute: a #PangoAttribute
@data: callback data passed to pango_attr_list_filter()
@user_data:
@Returns: %TRUE if the attribute should be filtered out
<!-- # Unused Parameters # -->
@data: callback data passed to pango_attr_list_filter()
<!-- ##### FUNCTION pango_attr_list_get_iterator ##### -->
......
......@@ -3,13 +3,8 @@
SUBDIRS = \
arabic \
basic \
hangul \
hebrew \
indic \
khmer \
syriac \
thai \
tibetan
thai
EXTRA_DIST = \
Module.mk \
......
include $(top_srcdir)/modules/Module.mk
if HAVE_FREETYPE
INCLUDES += $(FREETYPE_CFLAGS)
if INCLUDE_ARABIC_FC
noinst_LTLIBRARIES += libpango-arabic-fc.la
else
if DYNAMIC_ARABIC_FC
module_LTLIBRARIES += pango-arabic-fc.la
endif
endif
endif
fc_sources = \
arabic-fc.c \
arabic-ot.c \
arabic-ot.h
pango_arabic_fc_la_LDFLAGS = -module $(MODULE_LIBTOOL_OPTIONS)
pango_arabic_fc_la_LIBADD = $(pangoft2libs)
pango_arabic_fc_la_SOURCES = $(fc_sources)
libpango_arabic_fc_la_SOURCES = $(fc_sources)
libpango_arabic_fc_la_CFLAGS = -DPANGO_MODULE_PREFIX=_pango_arabic_fc
if INCLUDE_ARABIC_LANG
noinst_LTLIBRARIES += libpango-arabic-lang.la
......
/* Pango
* arabic-fc.c: Arabic shaper for FreeType-based backends
*
* Copyright (C) 2000, 2003, 2007 Red Hat Software
* Authors:
* Owen Taylor <otaylor@redhat.com>
* Behdad Esfahbod <behdad@behdad.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include "arabic-ot.h"
#include "pango-engine.h"
#include "pango-utils.h"
#include "pangofc-font.h"
/* No extra fields needed */
typedef PangoEngineShape ArabicEngineFc;
typedef PangoEngineShapeClass ArabicEngineFcClass ;
#define SCRIPT_ENGINE_NAME "ArabicScriptEngineFc"
#define RENDER_TYPE PANGO_RENDER_TYPE_FC
static PangoEngineScriptInfo arabic_scripts[] = {
{ PANGO_SCRIPT_ARABIC, "*" },
{ PANGO_SCRIPT_NKO, "*" }
};
static PangoEngineInfo script_engines[] = {
{
SCRIPT_ENGINE_NAME,
PANGO_ENGINE_TYPE_SHAPE,
RENDER_TYPE,
arabic_scripts, G_N_ELEMENTS(arabic_scripts)
}
};
static const PangoOTFeatureMap gsub_features[] =
{
{"ccmp", PANGO_OT_ALL_GLYPHS},
{"locl", PANGO_OT_ALL_GLYPHS},
{"isol", isolated},
{"fina", final},
{"medi", medial},
{"init", initial},
{"rlig", PANGO_OT_ALL_GLYPHS},
{"calt", PANGO_OT_ALL_GLYPHS},
{"liga", PANGO_OT_ALL_GLYPHS},
/* 'dlig' should be turned-on/off-able. lets turn off for now. */
/* {"dlig", PANGO_OT_ALL_GLYPHS}, */
{"cswh", PANGO_OT_ALL_GLYPHS},
{"mset", PANGO_OT_ALL_GLYPHS}
};
static const PangoOTFeatureMap gpos_features[] =
{
{"curs", PANGO_OT_ALL_GLYPHS},
{"kern", PANGO_OT_ALL_GLYPHS},
{"mark", PANGO_OT_ALL_GLYPHS},
{"mkmk", PANGO_OT_ALL_GLYPHS}
};
static void
arabic_engine_shape (PangoEngineShape *engine G_GNUC_UNUSED,
PangoFont *font,
const char *text,
gint length,
const PangoAnalysis *analysis,
PangoGlyphString *glyphs)
{
PangoFcFont *fc_font;
FT_Face face;
PangoOTRulesetDescription desc;
const PangoOTRuleset *ruleset;
PangoOTBuffer *buffer;
gulong *properties = NULL;
glong n_chars;
gunichar *wcs;
const char *p;
int cluster = 0;
gboolean rtl = analysis->level % 2 != 0;
gboolean reverse;
int i;
g_return_if_fail (font != NULL);
g_return_if_fail (text != NULL);
g_return_if_fail (length >= 0);
g_return_if_fail (analysis != NULL);
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
if (!face)
return;
buffer = pango_ot_buffer_new (fc_font);
pango_ot_buffer_set_rtl (buffer, rtl);
pango_ot_buffer_set_zero_width_marks (buffer, TRUE);
wcs = g_utf8_to_ucs4_fast (text, length, &n_chars);
properties = g_new0 (gulong, n_chars);
reverse = !rtl ^ (analysis->gravity == PANGO_GRAVITY_NORTH || analysis->gravity == PANGO_GRAVITY_WEST);
Arabic_Assign_Properties (wcs, properties, n_chars, reverse);
g_free (wcs);
p = text;
for (i=0; i < n_chars; i++)
{
gunichar wc;
PangoGlyph glyph;
wc = g_utf8_get_char (p);
if (g_unichar_type (wc) != G_UNICODE_NON_SPACING_MARK)
cluster = p - text;
if (pango_is_zero_width (wc))
glyph = PANGO_GLYPH_EMPTY;
else
{
gunichar c = wc;
if (analysis->level % 2)
g_unichar_get_mirror_char (c, &c);
/* Hack - Microsoft fonts are strange and don't contain the
* correct rules to shape ARABIC LETTER FARSI YEH in
* medial/initial position. It looks identical to ARABIC LETTER
* YEH in these positions, so we substitute if the font contains
* ARABIC LETTER YEH
*/
if (c == 0x6cc &&
((properties[i] & (initial | medial)) != (initial | medial)) &&
pango_fc_font_has_char (fc_font, 0x64a))
c = 0x64a;
glyph = pango_fc_font_get_glyph (fc_font, c);
}
if (!glyph)
glyph = PANGO_GET_UNKNOWN_GLYPH (wc);
pango_ot_buffer_add_glyph (buffer, glyph, properties[i], cluster);
p = g_utf8_next_char (p);
}
g_free (properties);
desc.script = analysis->script;
desc.language = analysis->language;
desc.n_static_gsub_features = G_N_ELEMENTS (gsub_features);
desc.static_gsub_features = gsub_features;
desc.n_static_gpos_features = G_N_ELEMENTS (gpos_features);
desc.static_gpos_features = gpos_features;
/* TODO populate other_features from analysis->extra_attrs */
desc.n_other_features = 0;
desc.other_features = NULL;
ruleset = pango_ot_ruleset_get_for_description (pango_ot_info_get (face), &desc);
pango_ot_ruleset_substitute (ruleset, buffer);
pango_ot_ruleset_position (ruleset, buffer);
pango_ot_buffer_output (buffer, glyphs);
pango_ot_buffer_destroy (buffer);
pango_fc_font_unlock_face (fc_font);
}
static void
arabic_engine_fc_class_init (PangoEngineShapeClass *class)
{
class->script_shape = arabic_engine_shape;
}
PANGO_ENGINE_SHAPE_DEFINE_TYPE (ArabicEngineFc, arabic_engine_fc,
arabic_engine_fc_class_init, NULL)
void
PANGO_MODULE_ENTRY(init) (GTypeModule *module)
{
arabic_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 (arabic_engine_fc_type, NULL);
else
return NULL;
}
/* This file is taken from the FreeType (1) tree. It's been reindented
* to roughly match Pango guidelines (in anticipation of future changes),
* but not otherwise much altered.
*/