forked from AuroraMiddleware/gtk
Merge branch 'bump-pango' into 'master'
Bump pango See merge request GNOME/gtk!1154
This commit is contained in:
commit
28898445ff
@ -15,10 +15,6 @@
|
|||||||
#include <pango/pangofc-font.h>
|
#include <pango/pangofc-font.h>
|
||||||
#include <hb.h>
|
#include <hb.h>
|
||||||
#include <hb-ot.h>
|
#include <hb-ot.h>
|
||||||
#include <hb-ft.h>
|
|
||||||
#include <freetype/ftmm.h>
|
|
||||||
#include <freetype/ftsnames.h>
|
|
||||||
#include <freetype/ttnameid.h>
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
#include "open-type-layout.h"
|
#include "open-type-layout.h"
|
||||||
@ -484,7 +480,6 @@ update_script_combo (void)
|
|||||||
GtkListStore *store;
|
GtkListStore *store;
|
||||||
hb_font_t *hb_font;
|
hb_font_t *hb_font;
|
||||||
gint i, j, k;
|
gint i, j, k;
|
||||||
FT_Face ft_face;
|
|
||||||
PangoFont *pango_font;
|
PangoFont *pango_font;
|
||||||
GHashTable *tags;
|
GHashTable *tags;
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
@ -505,8 +500,7 @@ update_script_combo (void)
|
|||||||
store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
|
store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
|
||||||
|
|
||||||
pango_font = get_pango_font ();
|
pango_font = get_pango_font ();
|
||||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
hb_font = hb_ft_font_create (ft_face, NULL);
|
|
||||||
|
|
||||||
tags = g_hash_table_new_full (tag_pair_hash, tag_pair_equal, g_free, NULL);
|
tags = g_hash_table_new_full (tag_pair_hash, tag_pair_equal, g_free, NULL);
|
||||||
|
|
||||||
@ -545,11 +539,8 @@ update_script_combo (void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_face_destroy (hb_face);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
|
||||||
g_object_unref (pango_font);
|
g_object_unref (pango_font);
|
||||||
|
|
||||||
g_hash_table_iter_init (&iter, tags);
|
g_hash_table_iter_init (&iter, tags);
|
||||||
@ -607,7 +598,6 @@ update_features (void)
|
|||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
guint script_index, lang_index;
|
guint script_index, lang_index;
|
||||||
PangoFont *pango_font;
|
PangoFont *pango_font;
|
||||||
FT_Face ft_face;
|
|
||||||
hb_font_t *hb_font;
|
hb_font_t *hb_font;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
@ -632,8 +622,7 @@ update_features (void)
|
|||||||
-1);
|
-1);
|
||||||
|
|
||||||
pango_font = get_pango_font ();
|
pango_font = get_pango_font ();
|
||||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
hb_font = hb_ft_font_create (ft_face, NULL);
|
|
||||||
|
|
||||||
if (hb_font)
|
if (hb_font)
|
||||||
{
|
{
|
||||||
@ -715,11 +704,8 @@ update_features (void)
|
|||||||
|
|
||||||
g_free (feat);
|
g_free (feat);
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_face_destroy (hb_face);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
|
||||||
g_object_unref (pango_font);
|
g_object_unref (pango_font);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -800,24 +786,29 @@ axes_equal (gconstpointer v1, gconstpointer v2)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_axis (FT_Var_Axis *ax, FT_Fixed value, int i)
|
add_axis (hb_face_t *hb_face,
|
||||||
|
hb_ot_var_axis_info_t *ax,
|
||||||
|
float value,
|
||||||
|
int i)
|
||||||
{
|
{
|
||||||
GtkWidget *axis_label;
|
GtkWidget *axis_label;
|
||||||
GtkWidget *axis_entry;
|
GtkWidget *axis_entry;
|
||||||
GtkWidget *axis_scale;
|
GtkWidget *axis_scale;
|
||||||
GtkAdjustment *adjustment;
|
GtkAdjustment *adjustment;
|
||||||
Axis *axis;
|
Axis *axis;
|
||||||
|
char name[20];
|
||||||
|
unsigned int name_len = 20;
|
||||||
|
|
||||||
axis_label = gtk_label_new (ax->name);
|
hb_ot_name_get_utf8 (hb_face, ax->name_id, HB_LANGUAGE_INVALID, &name_len, name);
|
||||||
|
|
||||||
|
axis_label = gtk_label_new (name);
|
||||||
gtk_widget_set_halign (axis_label, GTK_ALIGN_START);
|
gtk_widget_set_halign (axis_label, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (axis_label, GTK_ALIGN_BASELINE);
|
gtk_widget_set_valign (axis_label, GTK_ALIGN_BASELINE);
|
||||||
gtk_grid_attach (GTK_GRID (variations_grid), axis_label, 0, i, 1, 1);
|
gtk_grid_attach (GTK_GRID (variations_grid), axis_label, 0, i, 1, 1);
|
||||||
adjustment = gtk_adjustment_new ((double)FixedToFloat(value),
|
adjustment = gtk_adjustment_new (value, ax->min_value, ax->max_value,
|
||||||
(double)FixedToFloat(ax->minimum),
|
|
||||||
(double)FixedToFloat(ax->maximum),
|
|
||||||
1.0, 10.0, 0.0);
|
1.0, 10.0, 0.0);
|
||||||
axis_scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
|
axis_scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, adjustment);
|
||||||
gtk_scale_add_mark (GTK_SCALE (axis_scale), (double)FixedToFloat(ax->def), GTK_POS_TOP, NULL);
|
gtk_scale_add_mark (GTK_SCALE (axis_scale), ax->default_value, GTK_POS_TOP, NULL);
|
||||||
gtk_widget_set_valign (axis_scale, GTK_ALIGN_BASELINE);
|
gtk_widget_set_valign (axis_scale, GTK_ALIGN_BASELINE);
|
||||||
gtk_widget_set_hexpand (axis_scale, TRUE);
|
gtk_widget_set_hexpand (axis_scale, TRUE);
|
||||||
gtk_widget_set_size_request (axis_scale, 100, -1);
|
gtk_widget_set_size_request (axis_scale, 100, -1);
|
||||||
@ -842,9 +833,7 @@ add_axis (FT_Var_Axis *ax, FT_Fixed value, int i)
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char *name;
|
||||||
int n_axes;
|
unsigned int index;
|
||||||
guint32 *axes;
|
|
||||||
float *coords;
|
|
||||||
} Instance;
|
} Instance;
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
@ -870,559 +859,32 @@ free_instance (gpointer data)
|
|||||||
Instance *instance = data;
|
Instance *instance = data;
|
||||||
|
|
||||||
g_free (instance->name);
|
g_free (instance->name);
|
||||||
g_free (instance->axes);
|
|
||||||
g_free (instance->coords);
|
|
||||||
g_free (instance);
|
g_free (instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GHashTable *instances;
|
static GHashTable *instances;
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
const FT_UShort platform_id;
|
|
||||||
const FT_UShort encoding_id;
|
|
||||||
const char fromcode[12];
|
|
||||||
} FtEncoding;
|
|
||||||
|
|
||||||
#define TT_ENCODING_DONT_CARE 0xffff
|
|
||||||
|
|
||||||
static const FtEncoding ftEncoding[] = {
|
|
||||||
{ TT_PLATFORM_APPLE_UNICODE, TT_ENCODING_DONT_CARE, "UTF-16BE" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_ID_ROMAN, "MACINTOSH" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_ID_JAPANESE, "SJIS" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_SYMBOL_CS, "UTF-16BE" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_UNICODE_CS, "UTF-16BE" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_SJIS, "SJIS-WIN" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_GB2312, "GB2312" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_BIG_5, "BIG-5" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_WANSUNG, "Wansung" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_JOHAB, "Johab" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_ID_UCS_4, "UTF-16BE" },
|
|
||||||
{ TT_PLATFORM_ISO, TT_ISO_ID_7BIT_ASCII, "ASCII" },
|
|
||||||
{ TT_PLATFORM_ISO, TT_ISO_ID_10646, "UTF-16BE" },
|
|
||||||
{ TT_PLATFORM_ISO, TT_ISO_ID_8859_1, "ISO-8859-1" },
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
const FT_UShort platform_id;
|
|
||||||
const FT_UShort language_id;
|
|
||||||
const char lang[8];
|
|
||||||
} FtLanguage;
|
|
||||||
|
|
||||||
#define TT_LANGUAGE_DONT_CARE 0xffff
|
|
||||||
|
|
||||||
static const FtLanguage ftLanguage[] = {
|
|
||||||
{ TT_PLATFORM_APPLE_UNICODE, TT_LANGUAGE_DONT_CARE, "" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ENGLISH, "en" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_FRENCH, "fr" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GERMAN, "de" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ITALIAN, "it" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_DUTCH, "nl" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SWEDISH, "sv" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SPANISH, "es" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_DANISH, "da" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_PORTUGUESE, "pt" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_NORWEGIAN, "no" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_HEBREW, "he" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_JAPANESE, "ja" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ARABIC, "ar" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_FINNISH, "fi" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GREEK, "el" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ICELANDIC, "is" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MALTESE, "mt" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TURKISH, "tr" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_CROATIAN, "hr" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_CHINESE_TRADITIONAL, "zh-tw" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_URDU, "ur" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_HINDI, "hi" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_THAI, "th" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KOREAN, "ko" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_LITHUANIAN, "lt" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_POLISH, "pl" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_HUNGARIAN, "hu" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ESTONIAN, "et" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_LETTISH, "lv" },
|
|
||||||
/* { TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SAAMISK, ??? */
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_FAEROESE, "fo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_FARSI, "fa" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_RUSSIAN, "ru" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_CHINESE_SIMPLIFIED, "zh-cn" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_FLEMISH, "nl" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_IRISH, "ga" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ALBANIAN, "sq" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ROMANIAN, "ro" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_CZECH, "cs" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SLOVAK, "sk" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SLOVENIAN, "sl" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_YIDDISH, "yi" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SERBIAN, "sr" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MACEDONIAN, "mk" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_BULGARIAN, "bg" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_UKRAINIAN, "uk" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_BYELORUSSIAN, "be" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_UZBEK, "uz" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KAZAKH, "kk" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AZERBAIJANI, "az" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT, "az" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT, "ar" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ARMENIAN, "hy" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GEORGIAN, "ka" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MOLDAVIAN, "mo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KIRGHIZ, "ky" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TAJIKI, "tg" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TURKMEN, "tk" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN, "mo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT,"mo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT, "mo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_PASHTO, "ps" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KURDISH, "ku" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KASHMIRI, "ks" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SINDHI, "sd" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TIBETAN, "bo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_NEPALI, "ne" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SANSKRIT, "sa" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MARATHI, "mr" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_BENGALI, "bn" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ASSAMESE, "as" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GUJARATI, "gu" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_PUNJABI, "pa" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ORIYA, "or" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MALAYALAM, "ml" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KANNADA, "kn" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TAMIL, "ta" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TELUGU, "te" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SINHALESE, "si" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_BURMESE, "my" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_KHMER, "km" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_LAO, "lo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_VIETNAMESE, "vi" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_INDONESIAN, "id" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TAGALOG, "tl" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MALAY_ROMAN_SCRIPT, "ms" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MALAY_ARABIC_SCRIPT, "ms" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AMHARIC, "am" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TIGRINYA, "ti" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GALLA, "om" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SOMALI, "so" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SWAHILI, "sw" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_RUANDA, "rw" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_RUNDI, "rn" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_CHEWA, "ny" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MALAGASY, "mg" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_ESPERANTO, "eo" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_WELSH, "cy" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_BASQUE, "eu" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_CATALAN, "ca" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_LATIN, "la" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_QUECHUA, "qu" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GUARANI, "gn" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AYMARA, "ay" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TATAR, "tt" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_UIGHUR, "ug" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_DZONGKHA, "dz" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_JAVANESE, "jw" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SUNDANESE, "su" },
|
|
||||||
|
|
||||||
#if 0 /* these seem to be errors that have been dropped */
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SCOTTISH_GAELIC },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_IRISH_GAELIC },
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The following codes are new as of 2000-03-10 */
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GALICIAN, "gl" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AFRIKAANS, "af" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_BRETON, "br" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_INUKTITUT, "iu" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_SCOTTISH_GAELIC, "gd" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_MANX_GAELIC, "gv" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_IRISH_GAELIC, "ga" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_TONGAN, "to" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GREEK_POLYTONIC, "el" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_GREELANDIC, "ik" },
|
|
||||||
{ TT_PLATFORM_MACINTOSH, TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT,"az" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_SAUDI_ARABIA, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_IRAQ, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_EGYPT, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_LIBYA, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_ALGERIA, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_MOROCCO, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_TUNISIA, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_OMAN, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_YEMEN, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_SYRIA, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_JORDAN, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_LEBANON, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_KUWAIT, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_UAE, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_BAHRAIN, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_QATAR, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BULGARIAN_BULGARIA, "bg" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CATALAN_SPAIN, "ca" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHINESE_TAIWAN, "zh-tw" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHINESE_PRC, "zh-cn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHINESE_HONG_KONG, "zh-hk" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHINESE_SINGAPORE, "zh-sg" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHINESE_MACAU, "zh-mo" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CZECH_CZECH_REPUBLIC, "cs" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DANISH_DENMARK, "da" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GERMAN_GERMANY, "de" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GERMAN_SWITZERLAND, "de" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GERMAN_AUSTRIA, "de" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GERMAN_LUXEMBOURG, "de" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GERMAN_LIECHTENSTEI, "de" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GREEK_GREECE, "el" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_UNITED_STATES, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_UNITED_KINGDOM, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_AUSTRALIA, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_CANADA, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_NEW_ZEALAND, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_IRELAND, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_SOUTH_AFRICA, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_JAMAICA, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_CARIBBEAN, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_BELIZE, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_TRINIDAD, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_ZIMBABWE, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_PHILIPPINES, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT,"es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_MEXICO, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT,"es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_GUATEMALA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_COSTA_RICA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_PANAMA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC,"es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_VENEZUELA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_COLOMBIA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_PERU, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_ARGENTINA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_ECUADOR, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_CHILE, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_URUGUAY, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_PARAGUAY, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_BOLIVIA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_EL_SALVADOR, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_HONDURAS, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_NICARAGUA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_PUERTO_RICO, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FINNISH_FINLAND, "fi" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_FRANCE, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_BELGIUM, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_CANADA, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_SWITZERLAND, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_LUXEMBOURG, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_MONACO, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_HEBREW_ISRAEL, "he" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_HUNGARIAN_HUNGARY, "hu" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ICELANDIC_ICELAND, "is" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ITALIAN_ITALY, "it" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ITALIAN_SWITZERLAND, "it" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_JAPANESE_JAPAN, "ja" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA,"ko" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KOREAN_JOHAB_KOREA, "ko" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DUTCH_NETHERLANDS, "nl" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DUTCH_BELGIUM, "nl" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL, "no" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK, "nn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_POLISH_POLAND, "pl" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PORTUGUESE_BRAZIL, "pt" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PORTUGUESE_PORTUGAL, "pt" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND,"rm" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ROMANIAN_ROMANIA, "ro" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MOLDAVIAN_MOLDAVIA, "mo" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_RUSSIAN_RUSSIA, "ru" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_RUSSIAN_MOLDAVIA, "ru" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CROATIAN_CROATIA, "hr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SERBIAN_SERBIA_LATIN, "sr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC, "sr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SLOVAK_SLOVAKIA, "sk" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ALBANIAN_ALBANIA, "sq" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SWEDISH_SWEDEN, "sv" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SWEDISH_FINLAND, "sv" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_THAI_THAILAND, "th" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TURKISH_TURKEY, "tr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_URDU_PAKISTAN, "ur" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_INDONESIAN_INDONESIA, "id" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_UKRAINIAN_UKRAINE, "uk" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BELARUSIAN_BELARUS, "be" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SLOVENE_SLOVENIA, "sl" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ESTONIAN_ESTONIA, "et" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_LATVIAN_LATVIA, "lv" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_LITHUANIAN_LITHUANIA, "lt" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA,"lt" },
|
|
||||||
|
|
||||||
#ifdef TT_MS_LANGID_MAORI_NEW_ZELAND
|
|
||||||
/* this seems to be an error that have been dropped */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MAORI_NEW_ZEALAND, "mi" },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FARSI_IRAN, "fa" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_VIETNAMESE_VIET_NAM, "vi" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARMENIAN_ARMENIA, "hy" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN, "az" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC, "az" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BASQUE_SPAIN, "eu" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SORBIAN_GERMANY, "wen" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MACEDONIAN_MACEDONIA, "mk" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SUTU_SOUTH_AFRICA, "st" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TSONGA_SOUTH_AFRICA, "ts" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TSWANA_SOUTH_AFRICA, "tn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_VENDA_SOUTH_AFRICA, "ven" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_XHOSA_SOUTH_AFRICA, "xh" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ZULU_SOUTH_AFRICA, "zu" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA, "af" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GEORGIAN_GEORGIA, "ka" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS, "fo" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_HINDI_INDIA, "hi" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MALTESE_MALTA, "mt" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SAAMI_LAPONIA, "se" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM,"gd" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_IRISH_GAELIC_IRELAND, "ga" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MALAY_MALAYSIA, "ms" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM, "ms" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KAZAK_KAZAKSTAN, "kk" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SWAHILI_KENYA, "sw" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN, "uz" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC, "uz" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TATAR_TATARSTAN, "tt" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BENGALI_INDIA, "bn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PUNJABI_INDIA, "pa" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GUJARATI_INDIA, "gu" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ORIYA_INDIA, "or" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TAMIL_INDIA, "ta" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TELUGU_INDIA, "te" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KANNADA_INDIA, "kn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MALAYALAM_INDIA, "ml" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ASSAMESE_INDIA, "as" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MARATHI_INDIA, "mr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SANSKRIT_INDIA, "sa" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KONKANI_INDIA, "kok" },
|
|
||||||
|
|
||||||
/* new as of 2001-01-01 */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ARABIC_GENERAL, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHINESE_GENERAL, "zh" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_GENERAL, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_WEST_INDIES, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_REUNION, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_CONGO, "fr" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_SENEGAL, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_CAMEROON, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_COTE_D_IVOIRE, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_MALI, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA,"bs" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_URDU_INDIA, "ur" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TAJIK_TAJIKISTAN, "tg" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_YIDDISH_GERMANY, "yi" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN, "ky" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TURKMEN_TURKMENISTAN, "tk" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MONGOLIAN_MONGOLIA, "mn" },
|
|
||||||
|
|
||||||
/* the following seems to be inconsistent;
|
|
||||||
here is the current "official" way: */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIBETAN_BHUTAN, "bo" },
|
|
||||||
/* and here is what is used by Passport SDK */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIBETAN_CHINA, "bo" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DZONGHKA_BHUTAN, "dz" },
|
|
||||||
/* end of inconsistency */
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_WELSH_WALES, "cy" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KHMER_CAMBODIA, "km" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_LAO_LAOS, "lo" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BURMESE_MYANMAR, "my" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GALICIAN_SPAIN, "gl" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MANIPURI_INDIA, "mni" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SINDHI_INDIA, "sd" },
|
|
||||||
/* the following one is only encountered in Microsoft RTF specification */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KASHMIRI_PAKISTAN, "ks" },
|
|
||||||
/* the following one is not in the Passport list, looks like an omission */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KASHMIRI_INDIA, "ks" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_NEPALI_NEPAL, "ne" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_NEPALI_INDIA, "ne" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRISIAN_NETHERLANDS, "fy" },
|
|
||||||
|
|
||||||
/* new as of 2001-03-01 (from Office Xp) */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_HONG_KONG, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_INDIA, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_MALAYSIA, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_ENGLISH_SINGAPORE, "en" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SYRIAC_SYRIA, "syr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SINHALESE_SRI_LANKA, "si" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_CHEROKEE_UNITED_STATES, "chr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_INUKTITUT_CANADA, "iu" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_AMHARIC_ETHIOPIA, "am" },
|
|
||||||
#if 0
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TAMAZIGHT_MOROCCO },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN },
|
|
||||||
#endif
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PASHTO_AFGHANISTAN, "ps" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FILIPINO_PHILIPPINES, "phi" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_DHIVEHI_MALDIVES, "div" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_OROMO_ETHIOPIA, "om" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIGRIGNA_ETHIOPIA, "ti" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_TIGRIGNA_ERYTHREA, "ti" },
|
|
||||||
|
|
||||||
/* New additions from Windows Xp/Passport SDK 2001-11-10. */
|
|
||||||
|
|
||||||
/* don't ask what this one means... It is commented out currently. */
|
|
||||||
#if 0
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GREEK_GREECE2 },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_UNITED_STATES, "es" },
|
|
||||||
/* The following two IDs blatantly violate MS specs by using a */
|
|
||||||
/* sublanguage >,. */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SPANISH_LATIN_AMERICA, "es" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_NORTH_AFRICA, "fr" },
|
|
||||||
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_MOROCCO, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FRENCH_HAITI, "fr" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_BENGALI_BANGLADESH, "bn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN, "ar" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN,"mn" },
|
|
||||||
#if 0
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_EDO_NIGERIA },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_FULFULDE_NIGERIA },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_IBIBIO_NIGERIA },
|
|
||||||
#endif
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_HAUSA_NIGERIA, "ha" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_YORUBA_NIGERIA, "yo" },
|
|
||||||
/* language codes from, to, are (still) unknown. */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_IGBO_NIGERIA, "ibo" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_KANURI_NIGERIA, "kau" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_GUARANI_PARAGUAY, "gn" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_HAWAIIAN_UNITED_STATES, "haw" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_LATIN, "la" },
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_SOMALI_SOMALIA, "so" },
|
|
||||||
#if 0
|
|
||||||
/* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */
|
|
||||||
/* not written (but OTOH the peculiar writing system is worth */
|
|
||||||
/* studying). */
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_YI_CHINA },
|
|
||||||
#endif
|
|
||||||
{ TT_PLATFORM_MICROSOFT, TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES,"pap" },
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *
|
|
||||||
FcSfntNameLanguage (FT_SfntName *sname)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
FT_UShort platform_id = sname->platform_id;
|
|
||||||
FT_UShort language_id = sname->language_id;
|
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (ftLanguage); i++)
|
|
||||||
if (ftLanguage[i].platform_id == platform_id &&
|
|
||||||
(ftLanguage[i].language_id == TT_LANGUAGE_DONT_CARE ||
|
|
||||||
ftLanguage[i].language_id == language_id))
|
|
||||||
{
|
|
||||||
if (ftLanguage[i].lang[0] == '\0')
|
|
||||||
return NULL;
|
|
||||||
else
|
|
||||||
return ftLanguage[i].lang;
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
FcSfntNameTranscode (FT_SfntName *name)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
const char *fromcode;
|
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (ftEncoding); i++)
|
|
||||||
if (ftEncoding[i].platform_id == name->platform_id &&
|
|
||||||
(ftEncoding[i].encoding_id == TT_ENCODING_DONT_CARE ||
|
|
||||||
ftEncoding[i].encoding_id == name->encoding_id))
|
|
||||||
break;
|
|
||||||
if (i == G_N_ELEMENTS (ftEncoding))
|
|
||||||
return NULL;
|
|
||||||
fromcode = ftEncoding[i].fromcode;
|
|
||||||
|
|
||||||
return g_convert ((const char *)name->string, name->string_len, "UTF-8", fromcode, NULL, NULL, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
get_sfnt_name (FT_Face ft_face,
|
|
||||||
guint nameid)
|
|
||||||
{
|
|
||||||
guint count;
|
|
||||||
guint i, j;
|
|
||||||
const char * const *langs = g_get_language_names ();
|
|
||||||
char *res = NULL;
|
|
||||||
guint pos = G_MAXUINT;
|
|
||||||
|
|
||||||
count = FT_Get_Sfnt_Name_Count (ft_face);
|
|
||||||
for (i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
FT_SfntName name;
|
|
||||||
const char *lang;
|
|
||||||
|
|
||||||
if (FT_Get_Sfnt_Name (ft_face, i, &name) != 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (name.name_id != nameid)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
lang = FcSfntNameLanguage (&name);
|
|
||||||
for (j = 0; j < pos && langs[j]; j++)
|
|
||||||
{
|
|
||||||
if (strcmp (lang, langs[j]) == 0)
|
|
||||||
{
|
|
||||||
pos = j;
|
|
||||||
g_free (res);
|
|
||||||
res = FcSfntNameTranscode (&name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pos == 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
|
||||||
is_valid_subfamily_id (guint id)
|
|
||||||
{
|
|
||||||
return id == 2 || id == 17 || (255 < id && id < 32768);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_instance (FT_Face ft_face,
|
add_instance (hb_face_t *face,
|
||||||
FT_MM_Var *ft_mm_var,
|
unsigned int index,
|
||||||
FT_Var_Named_Style *ns,
|
GtkWidget *combo,
|
||||||
GtkWidget *combo,
|
int pos)
|
||||||
int pos)
|
|
||||||
{
|
{
|
||||||
Instance *instance;
|
Instance *instance;
|
||||||
int i;
|
hb_ot_name_id_t name_id;
|
||||||
|
char name[20];
|
||||||
|
unsigned int name_len = 20;
|
||||||
|
|
||||||
instance = g_new0 (Instance, 1);
|
instance = g_new0 (Instance, 1);
|
||||||
|
|
||||||
if (is_valid_subfamily_id (ns->strid))
|
name_id = hb_ot_var_named_instance_get_subfamily_name_id (face, index);
|
||||||
instance->name = get_sfnt_name (ft_face, ns->strid);
|
hb_ot_name_get_utf8 (face, name_id, HB_LANGUAGE_INVALID, &name_len, name);
|
||||||
if (!instance->name)
|
|
||||||
instance->name = g_strdup_printf ("Instance %d", pos);
|
instance->name = g_strdup_printf (name);
|
||||||
|
instance->index = index;
|
||||||
|
|
||||||
g_hash_table_add (instances, instance);
|
g_hash_table_add (instances, instance);
|
||||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), instance->name);
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), instance->name);
|
||||||
|
|
||||||
instance->n_axes = ft_mm_var->num_axis;
|
|
||||||
instance->axes = g_new (guint32, ft_mm_var->num_axis);
|
|
||||||
instance->coords = g_new (float, ft_mm_var->num_axis);
|
|
||||||
|
|
||||||
for (i = 0; i < ft_mm_var->num_axis; i++)
|
|
||||||
{
|
|
||||||
instance->axes[i] = ft_mm_var->axis[i].tag;
|
|
||||||
instance->coords[i] = FixedToFloat(ns->coords[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1439,6 +901,13 @@ instance_changed (GtkComboBox *combo)
|
|||||||
Instance *instance;
|
Instance *instance;
|
||||||
Instance ikey;
|
Instance ikey;
|
||||||
int i;
|
int i;
|
||||||
|
unsigned int coords_length;
|
||||||
|
float *coords = NULL;
|
||||||
|
hb_ot_var_axis_info_t *ai = NULL;
|
||||||
|
unsigned int n_axes;
|
||||||
|
PangoFont *pango_font = NULL;
|
||||||
|
hb_font_t *hb_font;
|
||||||
|
hb_face_t *hb_face;
|
||||||
|
|
||||||
text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo));
|
text = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo));
|
||||||
if (text[0] == '\0')
|
if (text[0] == '\0')
|
||||||
@ -1452,17 +921,29 @@ instance_changed (GtkComboBox *combo)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < instance->n_axes; i++)
|
pango_font = get_pango_font ();
|
||||||
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
|
hb_face = hb_font_get_face (hb_font);
|
||||||
|
|
||||||
|
n_axes = hb_ot_var_get_axis_infos (hb_face, 0, NULL, NULL);
|
||||||
|
ai = g_new (hb_ot_var_axis_info_t, n_axes);
|
||||||
|
hb_ot_var_get_axis_infos (hb_face, 0, &n_axes, ai);
|
||||||
|
|
||||||
|
coords = g_new (float, n_axes);
|
||||||
|
hb_ot_var_named_instance_get_design_coords (hb_face,
|
||||||
|
instance->index,
|
||||||
|
&coords_length,
|
||||||
|
coords);
|
||||||
|
|
||||||
|
for (i = 0; i < n_axes; i++)
|
||||||
{
|
{
|
||||||
Axis *axis;
|
Axis *axis;
|
||||||
Axis akey;
|
Axis akey;
|
||||||
guint32 tag;
|
|
||||||
gdouble value;
|
gdouble value;
|
||||||
|
|
||||||
tag = instance->axes[i];
|
value = coords[ai[i].axis_index];
|
||||||
value = instance->coords[i];
|
|
||||||
|
|
||||||
akey.tag = tag;
|
akey.tag = ai[i].tag;
|
||||||
axis = g_hash_table_lookup (axes, &akey);
|
axis = g_hash_table_lookup (axes, &akey);
|
||||||
if (axis)
|
if (axis)
|
||||||
{
|
{
|
||||||
@ -1474,17 +955,31 @@ instance_changed (GtkComboBox *combo)
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
g_free (text);
|
g_free (text);
|
||||||
|
g_clear_object (&pango_font);
|
||||||
|
g_free (ai);
|
||||||
|
g_free (coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
matches_instance (FT_Var_Named_Style *instance,
|
matches_instance (hb_face_t *hb_face,
|
||||||
FT_Fixed *coords,
|
unsigned int index,
|
||||||
FT_UInt num_coords)
|
unsigned int n_axes,
|
||||||
|
float *coords)
|
||||||
{
|
{
|
||||||
FT_UInt i;
|
float *instance_coords;
|
||||||
|
unsigned int coords_length;
|
||||||
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_coords; i++)
|
instance_coords = g_new (float, n_axes);
|
||||||
if (coords[i] != instance->coords[i])
|
coords_length = n_axes;
|
||||||
|
|
||||||
|
hb_ot_var_named_instance_get_design_coords (hb_face,
|
||||||
|
index,
|
||||||
|
&coords_length,
|
||||||
|
instance_coords);
|
||||||
|
|
||||||
|
for (i = 0; i < n_axes; i++)
|
||||||
|
if (instance_coords[i] != coords[i])
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -1515,14 +1010,31 @@ add_font_plane (int i)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: This doesn't work if the font has an avar table */
|
||||||
|
static float
|
||||||
|
denorm_coord (hb_ot_var_axis_info_t *axis, int coord)
|
||||||
|
{
|
||||||
|
float r = coord / 16384.0;
|
||||||
|
|
||||||
|
if (coord < 0)
|
||||||
|
return axis->default_value + r * (axis->default_value - axis->min_value);
|
||||||
|
else
|
||||||
|
return axis->default_value + r * (axis->max_value - axis->default_value);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_font_variations (void)
|
update_font_variations (void)
|
||||||
{
|
{
|
||||||
GtkWidget *child, *next;
|
GtkWidget *child, *next;
|
||||||
PangoFont *pango_font;
|
PangoFont *pango_font = NULL;
|
||||||
FT_Face ft_face;
|
hb_font_t *hb_font;
|
||||||
FT_MM_Var *ft_mm_var;
|
hb_face_t *hb_face;
|
||||||
FT_Error ret;
|
unsigned int n_axes;
|
||||||
|
hb_ot_var_axis_info_t *ai = NULL;
|
||||||
|
float *design_coords = NULL;
|
||||||
|
const int *coords;
|
||||||
|
unsigned int length;
|
||||||
|
int i;
|
||||||
|
|
||||||
child = gtk_widget_get_first_child (variations_grid);
|
child = gtk_widget_get_first_child (variations_grid);
|
||||||
while (child != NULL)
|
while (child != NULL)
|
||||||
@ -1538,62 +1050,63 @@ update_font_variations (void)
|
|||||||
g_hash_table_remove_all (instances);
|
g_hash_table_remove_all (instances);
|
||||||
|
|
||||||
pango_font = get_pango_font ();
|
pango_font = get_pango_font ();
|
||||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
|
hb_face = hb_font_get_face (hb_font);
|
||||||
|
|
||||||
ret = FT_Get_MM_Var (ft_face, &ft_mm_var);
|
n_axes = hb_ot_var_get_axis_infos (hb_face, 0, NULL, NULL);
|
||||||
if (ret == 0)
|
if (n_axes == 0)
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
ai = g_new0 (hb_ot_var_axis_info_t, n_axes);
|
||||||
|
design_coords = g_new (float, n_axes);
|
||||||
|
|
||||||
|
hb_ot_var_get_axis_infos (hb_face, 0, &n_axes, ai);
|
||||||
|
coords = hb_font_get_var_coords_normalized (hb_font, &length);
|
||||||
|
for (i = 0; i < length; i++)
|
||||||
|
design_coords[i] = denorm_coord (&ai[i], coords[i]);
|
||||||
|
|
||||||
|
if (hb_ot_var_get_named_instance_count (hb_face) > 0)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
GtkWidget *label;
|
||||||
FT_Fixed *coords;
|
GtkWidget *combo;
|
||||||
|
|
||||||
coords = g_new (FT_Fixed, ft_mm_var->num_axis);
|
label = gtk_label_new ("Instance");
|
||||||
ret = FT_Get_Var_Design_Coordinates (ft_face, ft_mm_var->num_axis, coords);
|
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||||
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||||
|
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
||||||
|
gtk_grid_attach (GTK_GRID (variations_grid), label, 0, -1, 2, 1);
|
||||||
|
|
||||||
if (ft_mm_var->num_namedstyles > 0)
|
combo = gtk_combo_box_text_new ();
|
||||||
|
gtk_widget_set_valign (combo, GTK_ALIGN_BASELINE);
|
||||||
|
|
||||||
|
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "");
|
||||||
|
|
||||||
|
for (i = 0; i < hb_ot_var_get_named_instance_count (hb_face); i++)
|
||||||
|
add_instance (hb_face, i, combo, i);
|
||||||
|
|
||||||
|
for (i = 0; i < hb_ot_var_get_named_instance_count (hb_face); i++)
|
||||||
{
|
{
|
||||||
GtkWidget *label;
|
if (matches_instance (hb_face, i, n_axes, design_coords))
|
||||||
GtkWidget *combo;
|
{
|
||||||
|
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i + 1);
|
||||||
label = gtk_label_new ("Instance");
|
break;
|
||||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
}
|
||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
|
||||||
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
|
||||||
gtk_grid_attach (GTK_GRID (variations_grid), label, 0, -1, 2, 1);
|
|
||||||
|
|
||||||
combo = gtk_combo_box_text_new ();
|
|
||||||
gtk_widget_set_valign (combo, GTK_ALIGN_BASELINE);
|
|
||||||
g_signal_connect (combo, "changed", G_CALLBACK (instance_changed), NULL);
|
|
||||||
gtk_grid_attach (GTK_GRID (variations_grid), combo, 1, -1, 2, 1);
|
|
||||||
|
|
||||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "");
|
|
||||||
|
|
||||||
for (i = 0; i < ft_mm_var->num_namedstyles; i++)
|
|
||||||
add_instance (ft_face, ft_mm_var, &ft_mm_var->namedstyle[i], combo, i);
|
|
||||||
for (i = 0; i < ft_mm_var->num_namedstyles; i++)
|
|
||||||
{
|
|
||||||
if (matches_instance (&ft_mm_var->namedstyle[i], coords, ft_mm_var->num_axis))
|
|
||||||
{
|
|
||||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), i + 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
instance_combo = combo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0)
|
gtk_grid_attach (GTK_GRID (variations_grid), combo, 1, -1, 2, 1);
|
||||||
{
|
g_signal_connect (combo, "changed", G_CALLBACK (instance_changed), NULL);
|
||||||
for (i = 0; i < ft_mm_var->num_axis; i++)
|
instance_combo = combo;
|
||||||
add_axis (&ft_mm_var->axis[i], coords[i], i);
|
}
|
||||||
|
|
||||||
add_font_plane (ft_mm_var->num_axis);
|
for (i = 0; i < n_axes; i++)
|
||||||
}
|
add_axis (hb_face, &ai[i], design_coords[i], i);
|
||||||
g_free (coords);
|
|
||||||
free (ft_mm_var);
|
|
||||||
}
|
|
||||||
|
|
||||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
add_font_plane (n_axes);
|
||||||
g_object_unref (pango_font);
|
|
||||||
|
done:
|
||||||
|
g_clear_object (&pango_font);
|
||||||
|
g_free (ai);
|
||||||
|
g_free (design_coords);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -18,6 +18,10 @@
|
|||||||
|
|
||||||
#include "language-names.h"
|
#include "language-names.h"
|
||||||
|
|
||||||
|
#ifndef ISO_CODES_PREFIX
|
||||||
|
#define ISO_CODES_PREFIX "/usr"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
|
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
|
||||||
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
|
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
|
||||||
|
|
||||||
|
@ -644,7 +644,7 @@ create_ascii_glyphs (PangoFont *font)
|
|||||||
PangoLanguage *language = pango_language_from_string ("en_US"); /* just pick one */
|
PangoLanguage *language = pango_language_from_string ("en_US"); /* just pick one */
|
||||||
PangoCoverage *coverage;
|
PangoCoverage *coverage;
|
||||||
PangoAnalysis not_a_hack = {
|
PangoAnalysis not_a_hack = {
|
||||||
.shape_engine = pango_font_find_shaper (font, language, MIN_ASCII_GLYPH), /* never changes */
|
.shape_engine = NULL, /* unused */
|
||||||
.lang_engine = NULL, /* unused by pango_shape() */
|
.lang_engine = NULL, /* unused by pango_shape() */
|
||||||
.font = font,
|
.font = font,
|
||||||
.level = 0,
|
.level = 0,
|
||||||
|
@ -58,18 +58,10 @@
|
|||||||
#include "gtkeventcontrollerscroll.h"
|
#include "gtkeventcontrollerscroll.h"
|
||||||
#include "gtkroot.h"
|
#include "gtkroot.h"
|
||||||
|
|
||||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
|
||||||
#include <pango/pangofc-font.h>
|
|
||||||
#include <hb.h>
|
|
||||||
#include <hb-ot.h>
|
#include <hb-ot.h>
|
||||||
#include <hb-ft.h>
|
|
||||||
#include <ft2build.h>
|
|
||||||
#include FT_FREETYPE_H
|
|
||||||
#include FT_MULTIPLE_MASTERS_H
|
|
||||||
#include "language-names.h"
|
#include "language-names.h"
|
||||||
#include "script-names.h"
|
#include "script-names.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "open-type-layout.h"
|
#include "open-type-layout.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -920,10 +912,7 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *fontchooser)
|
|||||||
|
|
||||||
/* Load data and set initial style-dependent parameters */
|
/* Load data and set initial style-dependent parameters */
|
||||||
gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
|
gtk_font_chooser_widget_load_fonts (fontchooser, TRUE);
|
||||||
|
|
||||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
|
||||||
gtk_font_chooser_widget_populate_features (fontchooser);
|
gtk_font_chooser_widget_populate_features (fontchooser);
|
||||||
#endif
|
|
||||||
|
|
||||||
gtk_font_chooser_widget_set_cell_size (fontchooser);
|
gtk_font_chooser_widget_set_cell_size (fontchooser);
|
||||||
gtk_font_chooser_widget_take_font_desc (fontchooser, NULL);
|
gtk_font_chooser_widget_take_font_desc (fontchooser, NULL);
|
||||||
@ -1474,12 +1463,8 @@ gtk_font_chooser_widget_ensure_selection (GtkFontChooserWidget *fontchooser)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
|
||||||
|
|
||||||
/* OpenType variations */
|
/* OpenType variations */
|
||||||
|
|
||||||
#define FixedToFloat(f) (((float)(f))/65536.0)
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_font_variations (GtkFontChooserWidget *fontchooser,
|
add_font_variations (GtkFontChooserWidget *fontchooser,
|
||||||
GString *s)
|
GString *s)
|
||||||
@ -1534,49 +1519,56 @@ adjustment_changed (GtkAdjustment *adjustment,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
should_show_axis (FT_Var_Axis *ax)
|
should_show_axis (hb_ot_var_axis_info_t *ax)
|
||||||
{
|
{
|
||||||
/* FIXME use FT_Get_Var_Axis_Flags */
|
if (ax->flags & HB_OT_VAR_AXIS_FLAG_HIDDEN)
|
||||||
if (ax->tag == FT_MAKE_TAG ('o', 'p', 's', 'z'))
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
is_named_instance (FT_Face face)
|
is_named_instance (hb_font_t *font)
|
||||||
{
|
{
|
||||||
return (face->face_index >> 16) > 0;
|
/* FIXME */
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
guint32 tag;
|
guint32 tag;
|
||||||
const char *name;
|
const char *name;
|
||||||
} axis_names[] = {
|
} axis_names[] = {
|
||||||
{ FT_MAKE_TAG ('w', 'd', 't', 'h'), N_("Width") },
|
{ HB_OT_TAG_VAR_AXIS_WIDTH, N_("Width") },
|
||||||
{ FT_MAKE_TAG ('w', 'g', 'h', 't'), N_("Weight") },
|
{ HB_OT_TAG_VAR_AXIS_WEIGHT, N_("Weight") },
|
||||||
{ FT_MAKE_TAG ('i', 't', 'a', 'l'), N_("Italic") },
|
{ HB_OT_TAG_VAR_AXIS_ITALIC, N_("Italic") },
|
||||||
{ FT_MAKE_TAG ('s', 'l', 'n', 't'), N_("Slant") },
|
{ HB_OT_TAG_VAR_AXIS_SLANT, N_("Slant") },
|
||||||
{ FT_MAKE_TAG ('o', 'p', 's', 'z'), N_("Optical Size") },
|
{ HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE, N_("Optical Size") },
|
||||||
};
|
};
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
add_axis (GtkFontChooserWidget *fontchooser,
|
add_axis (GtkFontChooserWidget *fontchooser,
|
||||||
FT_Face face,
|
hb_font_t *hb_font,
|
||||||
FT_Var_Axis *ax,
|
hb_ot_var_axis_info_t *ax,
|
||||||
FT_Fixed value,
|
int value,
|
||||||
int row)
|
int row)
|
||||||
{
|
{
|
||||||
GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
|
GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
|
||||||
|
hb_face_t *hb_face;
|
||||||
Axis *axis;
|
Axis *axis;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
char buffer[20];
|
||||||
|
unsigned int buffer_len = 20;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
hb_face = hb_font_get_face (hb_font);
|
||||||
|
|
||||||
axis = g_new (Axis, 1);
|
axis = g_new (Axis, 1);
|
||||||
axis->tag = ax->tag;
|
axis->tag = ax->tag;
|
||||||
axis->fontchooser = GTK_WIDGET (fontchooser);
|
axis->fontchooser = GTK_WIDGET (fontchooser);
|
||||||
|
|
||||||
name = ax->name;
|
hb_ot_name_get_utf8 (hb_face, ax->name_id, HB_LANGUAGE_INVALID, &buffer_len, buffer);
|
||||||
|
name = buffer;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (axis_names); i++)
|
for (i = 0; i < G_N_ELEMENTS (axis_names); i++)
|
||||||
{
|
{
|
||||||
if (axis_names[i].tag == ax->tag)
|
if (axis_names[i].tag == ax->tag)
|
||||||
@ -1585,16 +1577,18 @@ add_axis (GtkFontChooserWidget *fontchooser,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
axis->label = gtk_label_new (name);
|
axis->label = gtk_label_new (name);
|
||||||
|
|
||||||
gtk_widget_set_halign (axis->label, GTK_ALIGN_START);
|
gtk_widget_set_halign (axis->label, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (axis->label, GTK_ALIGN_BASELINE);
|
gtk_widget_set_valign (axis->label, GTK_ALIGN_BASELINE);
|
||||||
gtk_grid_attach (GTK_GRID (priv->axis_grid), axis->label, 0, row, 1, 1);
|
gtk_grid_attach (GTK_GRID (priv->axis_grid), axis->label, 0, row, 1, 1);
|
||||||
axis->adjustment = gtk_adjustment_new ((double)FixedToFloat(value),
|
axis->adjustment = gtk_adjustment_new ((double)value,
|
||||||
(double)FixedToFloat(ax->minimum),
|
(double)ax->min_value,
|
||||||
(double)FixedToFloat(ax->maximum),
|
(double)ax->max_value,
|
||||||
1.0, 10.0, 0.0);
|
1.0, 10.0, 0.0);
|
||||||
axis->scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, axis->adjustment);
|
axis->scale = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, axis->adjustment);
|
||||||
gtk_scale_add_mark (GTK_SCALE (axis->scale), (double)FixedToFloat(ax->def), GTK_POS_TOP, NULL);
|
gtk_scale_add_mark (GTK_SCALE (axis->scale), (double)ax->default_value, GTK_POS_TOP, NULL);
|
||||||
gtk_widget_set_valign (axis->scale, GTK_ALIGN_BASELINE);
|
gtk_widget_set_valign (axis->scale, GTK_ALIGN_BASELINE);
|
||||||
gtk_widget_set_hexpand (axis->scale, TRUE);
|
gtk_widget_set_hexpand (axis->scale, TRUE);
|
||||||
gtk_widget_set_size_request (axis->scale, 100, -1);
|
gtk_widget_set_size_request (axis->scale, 100, -1);
|
||||||
@ -1609,7 +1603,7 @@ add_axis (GtkFontChooserWidget *fontchooser,
|
|||||||
|
|
||||||
adjustment_changed (axis->adjustment, axis);
|
adjustment_changed (axis->adjustment, axis);
|
||||||
g_signal_connect (axis->adjustment, "value-changed", G_CALLBACK (adjustment_changed), axis);
|
g_signal_connect (axis->adjustment, "value-changed", G_CALLBACK (adjustment_changed), axis);
|
||||||
if (is_named_instance (face) || !should_show_axis (ax))
|
if (is_named_instance (hb_font) || !should_show_axis (ax))
|
||||||
{
|
{
|
||||||
gtk_widget_hide (axis->label);
|
gtk_widget_hide (axis->label);
|
||||||
gtk_widget_hide (axis->scale);
|
gtk_widget_hide (axis->scale);
|
||||||
@ -1621,15 +1615,31 @@ add_axis (GtkFontChooserWidget *fontchooser,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: This doesn't work if the font has an avar table */
|
||||||
|
static float
|
||||||
|
denorm_coord (hb_ot_var_axis_info_t *axis, int coord)
|
||||||
|
{
|
||||||
|
float r = coord / 16384.0;
|
||||||
|
|
||||||
|
if (coord < 0)
|
||||||
|
return axis->default_value + r * (axis->default_value - axis->min_value);
|
||||||
|
else
|
||||||
|
return axis->default_value + r * (axis->max_value - axis->default_value);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchooser)
|
gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchooser)
|
||||||
{
|
{
|
||||||
GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
|
GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
|
||||||
PangoFont *pango_font;
|
PangoFont *pango_font;
|
||||||
FT_Face ft_face;
|
hb_font_t *hb_font;
|
||||||
FT_MM_Var *ft_mm_var;
|
hb_face_t *hb_face;
|
||||||
FT_Error ret;
|
const int *coords;
|
||||||
|
unsigned int n_coords;
|
||||||
|
unsigned int n_axes;
|
||||||
|
hb_ot_var_axis_info_t *axes;
|
||||||
gboolean has_axis = FALSE;
|
gboolean has_axis = FALSE;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (priv->updating_variations)
|
if (priv->updating_variations)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -1642,39 +1652,30 @@ gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchoose
|
|||||||
|
|
||||||
pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
|
pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
|
||||||
priv->font_desc);
|
priv->font_desc);
|
||||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font));
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
|
hb_face = hb_font_get_face (hb_font);
|
||||||
|
|
||||||
ret = FT_Get_MM_Var (ft_face, &ft_mm_var);
|
if (!hb_ot_var_has_data (hb_face))
|
||||||
if (ret == 0)
|
return FALSE;
|
||||||
|
|
||||||
|
coords = hb_font_get_var_coords_normalized (hb_font, &n_coords);
|
||||||
|
|
||||||
|
n_axes = hb_ot_var_get_axis_count (hb_face);
|
||||||
|
axes = g_new0 (hb_ot_var_axis_info_t, n_axes);
|
||||||
|
hb_ot_var_get_axis_infos (hb_face, 0, &n_axes, axes);
|
||||||
|
|
||||||
|
for (i = 0; i < n_axes; i++)
|
||||||
{
|
{
|
||||||
int i;
|
float value;
|
||||||
FT_Fixed *coords;
|
if (coords && i < n_coords)
|
||||||
|
value = denorm_coord (&axes[i], coords[i]);
|
||||||
coords = g_new (FT_Fixed, ft_mm_var->num_axis);
|
else
|
||||||
for (i = 0; i < ft_mm_var->num_axis; i++)
|
value = axes[i].default_value;
|
||||||
coords[i] = ft_mm_var->axis[i].def;
|
if (add_axis (fontchooser, hb_font, &axes[i], value, i + 4))
|
||||||
|
has_axis = TRUE;
|
||||||
if (ft_face->face_index > 0)
|
|
||||||
{
|
|
||||||
int instance_id = ft_face->face_index >> 16;
|
|
||||||
if (instance_id && instance_id <= ft_mm_var->num_namedstyles)
|
|
||||||
{
|
|
||||||
FT_Var_Named_Style *instance = &ft_mm_var->namedstyle[instance_id - 1];
|
|
||||||
memcpy (coords, instance->coords, ft_mm_var->num_axis * sizeof (*coords));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < ft_mm_var->num_axis; i++)
|
|
||||||
{
|
|
||||||
if (add_axis (fontchooser, ft_face, &ft_mm_var->axis[i], coords[i], i + 4))
|
|
||||||
has_axis = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_free (coords);
|
|
||||||
free (ft_mm_var);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
g_free (axes);
|
||||||
g_object_unref (pango_font);
|
g_object_unref (pango_font);
|
||||||
|
|
||||||
return has_axis;
|
return has_axis;
|
||||||
@ -1801,16 +1802,19 @@ feat_pressed (GtkGesture *gesture,
|
|||||||
|
|
||||||
static char *
|
static char *
|
||||||
find_affected_text (hb_tag_t feature_tag,
|
find_affected_text (hb_tag_t feature_tag,
|
||||||
hb_face_t *hb_face,
|
hb_font_t *hb_font,
|
||||||
hb_tag_t script_tag,
|
hb_tag_t script_tag,
|
||||||
hb_tag_t lang_tag,
|
hb_tag_t lang_tag,
|
||||||
int max_chars)
|
int max_chars)
|
||||||
{
|
{
|
||||||
|
hb_face_t *hb_face;
|
||||||
unsigned int script_index = 0;
|
unsigned int script_index = 0;
|
||||||
unsigned int lang_index = 0;
|
unsigned int lang_index = 0;
|
||||||
unsigned int feature_index = 0;
|
unsigned int feature_index = 0;
|
||||||
GString *chars;
|
GString *chars;
|
||||||
|
|
||||||
|
hb_face = hb_font_get_face (hb_font);
|
||||||
|
|
||||||
chars = g_string_new ("");
|
chars = g_string_new ("");
|
||||||
|
|
||||||
hb_ot_layout_table_find_script (hb_face, HB_OT_TAG_GSUB, script_tag, &script_index);
|
hb_ot_layout_table_find_script (hb_face, HB_OT_TAG_GSUB, script_tag, &script_index);
|
||||||
@ -1838,7 +1842,6 @@ find_affected_text (hb_tag_t feature_tag,
|
|||||||
hb_set_t* glyphs_input = NULL;
|
hb_set_t* glyphs_input = NULL;
|
||||||
hb_set_t* glyphs_after = NULL;
|
hb_set_t* glyphs_after = NULL;
|
||||||
hb_set_t* glyphs_output = NULL;
|
hb_set_t* glyphs_output = NULL;
|
||||||
hb_font_t *hb_font = NULL;
|
|
||||||
hb_codepoint_t gid;
|
hb_codepoint_t gid;
|
||||||
|
|
||||||
glyphs_input = hb_set_create ();
|
glyphs_input = hb_set_create ();
|
||||||
@ -1852,9 +1855,6 @@ find_affected_text (hb_tag_t feature_tag,
|
|||||||
glyphs_after,
|
glyphs_after,
|
||||||
glyphs_output);
|
glyphs_output);
|
||||||
|
|
||||||
hb_font = hb_font_create (hb_face);
|
|
||||||
hb_ft_font_set_funcs (hb_font);
|
|
||||||
|
|
||||||
gid = -1;
|
gid = -1;
|
||||||
while (hb_set_next (glyphs_input, &gid)) {
|
while (hb_set_next (glyphs_input, &gid)) {
|
||||||
hb_codepoint_t ch;
|
hb_codepoint_t ch;
|
||||||
@ -1874,7 +1874,6 @@ find_affected_text (hb_tag_t feature_tag,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hb_set_destroy (glyphs_input);
|
hb_set_destroy (glyphs_input);
|
||||||
hb_font_destroy (hb_font);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1883,7 +1882,7 @@ find_affected_text (hb_tag_t feature_tag,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
update_feature_example (FeatureItem *item,
|
update_feature_example (FeatureItem *item,
|
||||||
hb_face_t *hb_face,
|
hb_font_t *hb_font,
|
||||||
hb_tag_t script_tag,
|
hb_tag_t script_tag,
|
||||||
hb_tag_t lang_tag,
|
hb_tag_t lang_tag,
|
||||||
PangoFontDescription *font_desc)
|
PangoFontDescription *font_desc)
|
||||||
@ -1937,9 +1936,9 @@ update_feature_example (FeatureItem *item,
|
|||||||
else if (strcmp (item->name, "frac") == 0)
|
else if (strcmp (item->name, "frac") == 0)
|
||||||
input = g_strdup ("1/2 2/3 7/8");
|
input = g_strdup ("1/2 2/3 7/8");
|
||||||
else if (strcmp (item->name, "nalt") == 0)
|
else if (strcmp (item->name, "nalt") == 0)
|
||||||
input = find_affected_text (item->tag, hb_face, script_tag, lang_tag, 3);
|
input = find_affected_text (item->tag, hb_font, script_tag, lang_tag, 3);
|
||||||
else
|
else
|
||||||
input = find_affected_text (item->tag, hb_face, script_tag, lang_tag, 10);
|
input = find_affected_text (item->tag, hb_font, script_tag, lang_tag, 10);
|
||||||
|
|
||||||
if (input[0] != '\0')
|
if (input[0] != '\0')
|
||||||
{
|
{
|
||||||
@ -2145,7 +2144,6 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
|||||||
{
|
{
|
||||||
GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
|
GtkFontChooserWidgetPrivate *priv = gtk_font_chooser_widget_get_instance_private (fontchooser);
|
||||||
PangoFont *pango_font;
|
PangoFont *pango_font;
|
||||||
FT_Face ft_face;
|
|
||||||
hb_font_t *hb_font;
|
hb_font_t *hb_font;
|
||||||
hb_tag_t script_tag;
|
hb_tag_t script_tag;
|
||||||
hb_tag_t lang_tag;
|
hb_tag_t lang_tag;
|
||||||
@ -2167,8 +2165,7 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
|||||||
|
|
||||||
pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
|
pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
|
||||||
priv->font_desc);
|
priv->font_desc);
|
||||||
ft_face = pango_fc_font_lock_face (PANGO_FC_FONT (pango_font)),
|
hb_font = pango_font_get_hb_font (pango_font);
|
||||||
hb_font = hb_ft_font_create (ft_face, NULL);
|
|
||||||
|
|
||||||
if (hb_font)
|
if (hb_font)
|
||||||
{
|
{
|
||||||
@ -2214,7 +2211,7 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
|||||||
gtk_widget_show (item->top);
|
gtk_widget_show (item->top);
|
||||||
gtk_widget_show (gtk_widget_get_parent (item->top));
|
gtk_widget_show (gtk_widget_get_parent (item->top));
|
||||||
|
|
||||||
update_feature_example (item, hb_face, script_tag, lang_tag, priv->font_desc);
|
update_feature_example (item, hb_font, script_tag, lang_tag, priv->font_desc);
|
||||||
|
|
||||||
if (GTK_IS_RADIO_BUTTON (item->feat))
|
if (GTK_IS_RADIO_BUTTON (item->feat))
|
||||||
{
|
{
|
||||||
@ -2227,11 +2224,8 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_font_destroy (hb_font);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pango_fc_font_unlock_face (PANGO_FC_FONT (pango_font));
|
|
||||||
g_object_unref (pango_font);
|
g_object_unref (pango_font);
|
||||||
|
|
||||||
return has_feature;
|
return has_feature;
|
||||||
@ -2284,8 +2278,6 @@ update_font_features (GtkFontChooserWidget *fontchooser)
|
|||||||
gtk_font_chooser_widget_update_preview_attributes (fontchooser);
|
gtk_font_chooser_widget_update_preview_attributes (fontchooser);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser,
|
gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser,
|
||||||
const PangoFontDescription *font_desc,
|
const PangoFontDescription *font_desc,
|
||||||
@ -2331,12 +2323,11 @@ gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser
|
|||||||
|
|
||||||
gtk_font_chooser_widget_update_marks (fontchooser);
|
gtk_font_chooser_widget_update_marks (fontchooser);
|
||||||
|
|
||||||
#if defined(HAVE_HARFBUZZ) && defined(HAVE_PANGOFT)
|
|
||||||
if (gtk_font_chooser_widget_update_font_features (fontchooser))
|
if (gtk_font_chooser_widget_update_font_features (fontchooser))
|
||||||
has_tweak = TRUE;
|
has_tweak = TRUE;
|
||||||
if (gtk_font_chooser_widget_update_font_variations (fontchooser))
|
if (gtk_font_chooser_widget_update_font_variations (fontchooser))
|
||||||
has_tweak = TRUE;
|
has_tweak = TRUE;
|
||||||
#endif
|
|
||||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (priv->tweak_action), has_tweak);
|
g_simple_action_set_enabled (G_SIMPLE_ACTION (priv->tweak_action), has_tweak);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2553,4 +2544,3 @@ gtk_font_chooser_widget_get_tweak_action (GtkWidget *widget)
|
|||||||
|
|
||||||
return priv->tweak_action;
|
return priv->tweak_action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1550,6 +1550,25 @@ attribute_from_text (GtkBuilder *builder,
|
|||||||
if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_SHOW_FLAGS, value, &val, error))
|
if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_SHOW_FLAGS, value, &val, error))
|
||||||
attribute = pango_attr_show_new (g_value_get_flags (&val));
|
attribute = pango_attr_show_new (g_value_get_flags (&val));
|
||||||
break;
|
break;
|
||||||
|
case PANGO_ATTR_INSERT_HYPHENS:
|
||||||
|
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
|
||||||
|
attribute = pango_attr_insert_hyphens_new (g_value_get_boolean (&val));
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
#if PANGO_VERSION_CHECK(1,45,0)
|
||||||
|
case PANGO_ATTR_OVERLINE:
|
||||||
|
if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_OVERLINE, value, &val, NULL))
|
||||||
|
attribute = pango_attr_overline_new (g_value_get_enum (&val));
|
||||||
|
break;
|
||||||
|
case PANGO_ATTR_OVERLINE_COLOR:
|
||||||
|
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
|
||||||
|
{
|
||||||
|
color = g_value_get_boxed (&val);
|
||||||
|
attribute = pango_attr_overline_color_new (color->red * 65535,
|
||||||
|
color->green * 65535,
|
||||||
|
color->blue * 65535);
|
||||||
|
}
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
case PANGO_ATTR_INVALID:
|
case PANGO_ATTR_INVALID:
|
||||||
default:
|
default:
|
||||||
|
@ -19,6 +19,10 @@
|
|||||||
|
|
||||||
#include "language-names.h"
|
#include "language-names.h"
|
||||||
|
|
||||||
|
#ifndef ISO_CODES_PREFIX
|
||||||
|
#define ISO_CODES_PREFIX "/usr"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
|
#define ISO_CODES_DATADIR ISO_CODES_PREFIX "/share/xml/iso-codes"
|
||||||
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
|
#define ISO_CODES_LOCALESDIR ISO_CODES_PREFIX "/share/locale"
|
||||||
|
|
||||||
|
29
meson.build
29
meson.build
@ -27,7 +27,7 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req)
|
glib_req = '>= @0@.@1@.@2@'.format(glib_major_req, glib_minor_req, glib_micro_req)
|
||||||
pango_req = '>= 1.41.0'
|
pango_req = '>= 1.44.0'
|
||||||
fribidi_req = '>= 0.19.7'
|
fribidi_req = '>= 0.19.7'
|
||||||
atk_req = '>= 2.15.1'
|
atk_req = '>= 2.15.1'
|
||||||
cairo_req = '>= 1.14.0'
|
cairo_req = '>= 1.14.0'
|
||||||
@ -335,33 +335,6 @@ fribidi_dep = dependency('fribidi', version: fribidi_req,
|
|||||||
require_pangoft2 = wayland_enabled or x11_enabled
|
require_pangoft2 = wayland_enabled or x11_enabled
|
||||||
pangoft_dep = dependency('pangoft2', required: false)
|
pangoft_dep = dependency('pangoft2', required: false)
|
||||||
|
|
||||||
if pangoft_dep.found()
|
|
||||||
# Need at least 2.7.1 for FT_Get_Var_Design_Coordinates()
|
|
||||||
# We get the dependency itself from pango, but pango doesn't care
|
|
||||||
# about ft2 version, so an extra check is needed.
|
|
||||||
ft2_dep = dependency('freetype2', version: '>= 2.7.1', required: require_pangoft2)
|
|
||||||
|
|
||||||
# Fallback case: Look for the FreeType2 headers and library manually when its .pc
|
|
||||||
# file is not available, such as on Visual Studio
|
|
||||||
if not ft2_dep.found()
|
|
||||||
ft2lib = ft2_dep
|
|
||||||
if cc.has_header('ft2build.h')
|
|
||||||
ft2_libnames = ['freetype', 'freetypemt']
|
|
||||||
foreach lib: ft2_libnames
|
|
||||||
if not ft2_dep.found()
|
|
||||||
ft2lib = cc.find_library(lib)
|
|
||||||
# If the FreeType2 library is found, check for FT_Get_Var_Design_Coordinates()
|
|
||||||
if ft2lib.found()
|
|
||||||
if cc.has_function('FT_Get_Var_Design_Coordinates', dependencies: ft2lib)
|
|
||||||
ft2_dep = ft2lib
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if require_pangoft2
|
if require_pangoft2
|
||||||
pangoft_dep = dependency('pangoft2', fallback : ['pango', 'libpangoft2_dep'])
|
pangoft_dep = dependency('pangoft2', fallback : ['pango', 'libpangoft2_dep'])
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user