./pango-1.26.0-i686/ 0000755 0000000 0000000 00000000000 11271772643 012243 5 ustar root root ./pango-1.26.0-i686/etc/ 0000755 0000000 0000000 00000000000 11271752004 013003 5 ustar root root ./pango-1.26.0-i686/etc/pango/ 0000755 0000000 0000000 00000000000 11271752013 014107 5 ustar root root ./pango-1.26.0-i686/etc/pango/pango.modules 0000644 0000000 0000000 00000007250 11271751774 016626 0 ustar root root # Pango Modules file
# Automatically generated file, do not edit
#
# ModulesPath = /usr/lib/pango/1.6.0/modules
#
/usr/lib/pango/1.6.0/modules/pango-hangul-fc.so HangulScriptEngineFc PangoEngineShape PangoRenderFc hangul:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so devaIndicScriptEngineLang PangoEngineLang PangoRenderNone devanagari:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so bengIndicScriptEngineLang PangoEngineLang PangoRenderNone bengali:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so guruIndicScriptEngineLang PangoEngineLang PangoRenderNone gurmukhi:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so gujrIndicScriptEngineLang PangoEngineLang PangoRenderNone gujarati:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so oryaIndicScriptEngineLang PangoEngineLang PangoRenderNone oriya:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so tamlIndicScriptEngineLang PangoEngineLang PangoRenderNone tamil:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so teluIndicScriptEngineLang PangoEngineLang PangoRenderNone telugu:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so kndaIndicScriptEngineLang PangoEngineLang PangoRenderNone kannada:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so mlymIndicScriptEngineLang PangoEngineLang PangoRenderNone malayalam:*
/usr/lib/pango/1.6.0/modules/pango-indic-lang.so sinhIndicScriptEngineLang PangoEngineLang PangoRenderNone sinhala:*
/usr/lib/pango/1.6.0/modules/pango-basic-fc.so BasicScriptEngineFc PangoEngineShape PangoRenderFc latin:* cyrillic:* greek:* armenian:* georgian:* runic:* ogham:* bopomofo:* cherokee:* coptic:* deseret:* ethiopic:* gothic:* han:* hiragana:* katakana:* old-italic:* canadian-aboriginal:* yi:* braille:* cypriot:* limbu:* osmanya:* shavian:* linear-b:* ugaritic:* glagolitic:* cuneiform:* phoenician:* common:
/usr/lib/pango/1.6.0/modules/pango-basic-x.so BasicScriptEngineX PangoEngineShape PangoRenderX common:
/usr/lib/pango/1.6.0/modules/pango-thai-fc.so ThaiScriptEngineFc PangoEngineShape PangoRenderFc thai:* lao:*
/usr/lib/pango/1.6.0/modules/pango-tibetan-fc.so TibetanScriptEngineFc PangoEngineShape PangoRenderFc tibetan:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so devaScriptEngineFc PangoEngineShape PangoRenderFc devanagari:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so bengScriptEngineFc PangoEngineShape PangoRenderFc bengali:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so guruScriptEngineFc PangoEngineShape PangoRenderFc gurmukhi:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so gujrScriptEngineFc PangoEngineShape PangoRenderFc gujarati:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so oryaScriptEngineFc PangoEngineShape PangoRenderFc oriya:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so tamlScriptEngineFc PangoEngineShape PangoRenderFc tamil:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so teluScriptEngineFc PangoEngineShape PangoRenderFc telugu:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so kndaScriptEngineFc PangoEngineShape PangoRenderFc kannada:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so mlymScriptEngineFc PangoEngineShape PangoRenderFc malayalam:*
/usr/lib/pango/1.6.0/modules/pango-indic-fc.so sinhScriptEngineFc PangoEngineShape PangoRenderFc sinhala:*
/usr/lib/pango/1.6.0/modules/pango-hebrew-fc.so HebrewScriptEngineFc PangoEngineShape PangoRenderFc hebrew:*
/usr/lib/pango/1.6.0/modules/pango-arabic-fc.so ArabicScriptEngineFc PangoEngineShape PangoRenderFc arabic:* nko:*
/usr/lib/pango/1.6.0/modules/pango-khmer-fc.so KhmerScriptEngineFc PangoEngineShape PangoRenderFc khmer:*
/usr/lib/pango/1.6.0/modules/pango-arabic-lang.so ArabicScriptEngineLang PangoEngineLang PangoRenderNone arabic:*
/usr/lib/pango/1.6.0/modules/pango-syriac-fc.so SyriacScriptEngineFc PangoEngineShape PangoRenderFc syriac:*
./pango-1.26.0-i686/etc/pango/pangox.aliases 0000644 0000000 0000000 00000026266 11271751770 016773 0 ustar root root # File defining aliases of PangoFontDescription to X font set
#
# family style variant weight stretch XLFD
sans normal normal normal normal \
"-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*,\
-*-gulim-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
sans italic normal normal normal \
"-*-helvetica-medium-o-normal--*-*-*-*-*-*-*-*,\
-*-gulim-medium-o-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
sans normal normal bold normal \
"-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*,\
-*-gulim-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
sans italic normal bold normal \
"-*-helvetica-bold-o-normal--*-*-*-*-*-*-*-*,\
-*-gulim-bold-o-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
serif normal normal normal normal \
"-*-times-medium-r-normal--*-*-*-*-*-*-*-*,\
-*-batang-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
serif italic normal normal normal \
"-*-times-medium-i-normal--*-*-*-*-*-*-*-*,\
-*-batang-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
serif normal normal bold normal \
"-*-times-bold-r-normal--*-*-*-*-*-*-*-*,\
-*-batang-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
serif italic normal bold normal \
"-*-times-bold-i-normal--*-*-*-*-*-*-*-*,\
-*-batang-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
monospace normal normal normal normal \
"-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-*-dotum-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
monospace italic normal normal normal \
"-*-fixed-medium-i-normal--*-*-*-*-*-*-*-*,\
-*-dotum-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
monospace normal normal bold normal \
"-*-fixed-bold-r-normal--*-*-*-*-*-*-*-*,\
-*-dotum-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
monospace italic normal bold normal \
"-*-fixed-bold-i-normal--*-*-*-*-*-*-*-*,\
-*-dotum-bold-r-normal--*-*-*-*-*-*-ksc5601.1987-0,\
-*-clearlyu-medium-r-normal--*-*-*-*-*-*-iso10646-1,\
-*-fixed-medium-r-normal--*-*-*-*-*-*-*-*,\
-kaist-iyagi-bold-r-normal--*-*-*-*-*-*-johab-1,\
-*-song ti-medium-r-normal--*-*-*-*-*-*-*-*,\
-freetype-unitamil-medium-r-normal--*-*-*-*-*-*-iso10646-tam,\
-*-devanagari-medium-r-normal--*-*-*-*-*-*-iso10646-dev,\
-*-gujarati-medium-r-normal--*-*-*-*-*-*-iso10646-guj,\
-*-gurmukhi-medium-r-normal--*-*-*-*-*-*-iso10646-gur,\
-*-bengali-medium-r-normal--*-*-*-*-*-*-iso10646-bng,\
-*-kannada-medium-r-normal--*-*-*-*-*-*-iso10646-kan,\
-*-burmese-medium-r-normal--*-*-*-*-*-*-iso10646-brm,\
-*-buginese-medium-r-normal--*-*-*-*-*-*-iso10646-bgn,\
-*-oriya-medium-r-normal--*-*-*-*-*-*-iso10646-ori,\
-daewoo-mincho-medium-r-normal--*-*-*-*-*-*-ksc5601.1987-0"
./pango-1.26.0-i686/usr/ 0000755 0000000 0000000 00000000000 11271752013 013041 5 ustar root root ./pango-1.26.0-i686/usr/share/ 0000755 0000000 0000000 00000000000 11271752013 014143 5 ustar root root ./pango-1.26.0-i686/usr/share/man/ 0000755 0000000 0000000 00000000000 11271752013 014716 5 ustar root root ./pango-1.26.0-i686/usr/share/man/man1/ 0000755 0000000 0000000 00000000000 11271752021 015551 5 ustar root root ./pango-1.26.0-i686/usr/share/man/man1/pango-view.1 0000644 0000000 0000000 00000005317 11271751776 017735 0 ustar root root .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
.TH PANGO-VIEW "1" "September 2009" "pango-view (pango) 1.26.0" "User Commands"
.SH NAME
pango-view \- Pango text viewer
.SH DESCRIPTION
.SS "Usage:"
.IP
pango\-view [OPTION...] \- FILE
.SS "Help Options:"
.TP
\-?, \fB\-\-help\fR
Show help options
.TP
\fB\-\-help\-all\fR
Show all help options
.TP
\fB\-\-help\-cairo\fR
Options understood by the cairo backend
.SS "Cairo backend options:"
.TP
\fB\-\-annotate\fR=\fI1\fR or 2
Annotate the output
.SS "Application Options:"
.TP
\fB\-\-no\-auto\-dir\fR
No layout direction according to contents
.TP
\fB\-\-backend\fR=\fIcairo\fR/xft/ft2/x
Pango backend to use for rendering (default: cairo)
.TP
\fB\-\-background\fR=\fIred\fR/#rrggbb/#rrggbbaa/transparent
Set the background color
.TP
\fB\-q\fR, \fB\-\-no\-display\fR
Do not display (just write to file or whatever)
.TP
\fB\-\-dpi\fR=\fInumber\fR
Set the resolution
.TP
\fB\-\-align\fR=\fIleft\fR/center/right
Text alignment
.TP
\fB\-\-ellipsize\fR=\fIstart\fR/middle/end
Ellipsization mode
.TP
\fB\-\-font\fR=\fIdescription\fR
Set the font description
.TP
\fB\-\-foreground\fR=\fIred\fR/#rrggbb/#rrggbbaa
Set the text color
.TP
\fB\-\-gravity\fR=\fIsouth\fR/east/north/west/auto
Base gravity: glyph rotation
.TP
\fB\-\-gravity\-hint\fR=\fInatural\fR/strong/line
Gravity hint
.TP
\fB\-\-header\fR
Display the options in the output
.TP
\fB\-\-height=\fR+points/\-numlines
Height in points (positive) or number of lines (negative) for ellipsizing
.TP
\fB\-\-hinting\fR=\fInone\fR/auto/full
Hinting style
.TP
\fB\-\-indent\fR=\fIpoints\fR
Width in points to indent paragraphs
.TP
\fB\-\-justify\fR
Align paragraph lines to be justified
.TP
\fB\-\-language\fR=\fIen_US\fR/etc
Language to use for font selection
.TP
\fB\-\-margin\fR=\fIpixels\fR
Set the margin on the output in pixels
.TP
\fB\-\-markup\fR
Interpret text as Pango markup
.TP
\fB\-o\fR, \fB\-\-output\fR=\fIfile\fR
Save rendered image to output file
.TP
\fB\-\-pangorc\fR=\fIfile\fR
pangorc file to use (default is ./pangorc)
.TP
\fB\-\-rtl\fR
Set base direction to right\-to\-left
.TP
\fB\-\-rotate\fR=\fIdegrees\fR
Angle at which to rotate results
.TP
\fB\-n\fR, \fB\-\-runs\fR=\fIinteger\fR
Run Pango layout engine this many times
.TP
\fB\-\-single\-par\fR
Enable single\-paragraph mode
.TP
\fB\-t\fR, \fB\-\-text\fR=\fIstring\fR
Text to display (instead of a file)
.TP
\fB\-\-version\fR
Show version numbers
.TP
\fB\-\-waterfall\fR
Create a waterfall display
.TP
\fB\-w\fR, \fB\-\-width\fR=\fIpoints\fR
Width in points to which to wrap lines or ellipsize
.TP
\fB\-\-wrap\fR=\fIword\fR/char/word\-char
Text wrapping mode (needs a width to be set)
.PP
Pango module interface version: 1.6.0
Linked Pango library has a different version: 1.25.6
./pango-1.26.0-i686/usr/share/man/man1/pango-querymodules.1 0000644 0000000 0000000 00000003054 11271751776 021515 0 ustar root root '\" t
.\" Title: pango-querymodules
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.74.3
| Pango Reference Manual |
|---|
pango-querymodulespango-querymodules — Module registration utility |
pango-querymodules [module...]
pango-querymodules collects information about loadable
modules for Pango and writes it to stdout.
If called without arguments, it looks for modules in the Pango module path.
If called with arguments, it looks for the specified modules. The arguments may be absolute or relative paths.
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
PangoEngineInfo;
PangoEngineScriptInfo;
PangoEngine;
PangoEngineClass;
#define PANGO_RENDER_TYPE_NONE
void script_engine_list (PangoEngineInfo **engines,
int *n_engines);
void script_engine_init (GTypeModule *module);
void script_engine_exit (void);
PangoEngine * script_engine_create (const char *id);
Pango utilizes a module architecture in which the language-specific and render-system-specific components are provided by loadable modules. Each loadable module supplies one or more engines. Each engine has an associated engine type and render type. These two types are represented by strings.
Each dynamically-loaded module exports several functions which provide
the public API. These functions are script_engine_list(),
script_engine_init() and script_engine_exit, and
script_engine_create(). The latter three functions are used when
creating engines from the module at run time, while the first
function is used when building a catalog of all available modules.
typedef struct {
const gchar *id;
const gchar *engine_type;
const gchar *render_type;
PangoEngineScriptInfo *scripts;
gint n_scripts;
} PangoEngineInfo;
The PangoEngineInfo structure contains information about a particular engine. It contains the following fields:
const gchar * |
a unique string ID for the engine. |
const gchar * |
a string identifying the engine type. |
const gchar * |
a string identifying the render type. |
PangoEngineScriptInfo * |
array of scripts this engine supports. |
gint |
number of items in scripts.
|
typedef struct {
PangoScript script;
const gchar *langs;
} PangoEngineScriptInfo;
The PangoEngineScriptInfo structure contains information about how the shaper covers a particular script.
PangoScript |
a PangoScript. The value PANGO_SCRIPT_COMMON has
the special meaning here of "all scripts"
|
const gchar * |
a semicolon separated list of languages that this engine handles for this script. This may be empty, in which case the engine is saying that it is a fallback choice for all languages for this range, but should not be used if another engine indicates that it is specific for the language for a given code point. An entry in this list of "*" indicates that this engine is specific to all languages for this range. |
typedef struct _PangoEngine PangoEngine;
PangoEngine is the base class for all types of language and script specific engines. It has no functionality by itself.
#define PANGO_RENDER_TYPE_NONE "PangoRenderNone"
A string constant defining the render type for engines that are not rendering-system specific.
void script_engine_list (PangoEngineInfo **engines, int *n_engines);
Function to be provided by a module to list the engines that the module supplies. The function stores a pointer to an array of PangoEngineInfo structures and the length of that array in the given location.
Note that script_engine_init() will not be called before this
function.
|
location to store a pointer to an array of engines. |
|
location to store the number of elements in engines.
|
void script_engine_init (GTypeModule *module);
Function to be provided by a module to register any GObject types in the module.
|
a GTypeModule structure used to associate any GObject types created in this module with the module. |
void script_engine_exit (void);
Function to be provided by the module that is called when the module is unloading. Frequently does nothing.
PangoEngine * script_engine_create (const char *id);
Function to be provided by the module to create an instance of one of the engines implemented by the module.
|
the ID of an engine as reported by script_engine_list. |
Returns : |
a newly created PangoEngine of the specified
type, or NULL if an error occurred. (In normal operation,
a module should not return NULL. A NULL return is only
acceptable in the case where system misconfiguration or
bugs in the driver routine are encountered.)
|
| Pango Reference Manual |
|---|
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
typedef PangoOTTag; PangoOTInfo; PangoOTBuffer; PangoOTGlyph; PangoOTRuleset; PangoOTRulesetDescription; enum PangoOTTableType; PangoOTFeatureMap; #define PANGO_OT_TAG_MAKE (c1,c2,c3,c4) #define PANGO_OT_TAG_MAKE_FROM_STRING (s) #define PANGO_OT_ALL_GLYPHS #define PANGO_OT_NO_FEATURE #define PANGO_OT_NO_SCRIPT #define PANGO_OT_DEFAULT_LANGUAGE #define PANGO_OT_TAG_DEFAULT_LANGUAGE #define PANGO_OT_TAG_DEFAULT_SCRIPT PangoOTInfo * pango_ot_info_get (FT_Face face); gboolean pango_ot_info_find_script (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag script_tag, guint *script_index); gboolean pango_ot_info_find_language (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag, guint *language_index, guint *required_feature_index); gboolean pango_ot_info_find_feature (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag feature_tag, guint script_index, guint language_index, guint *feature_index); PangoOTTag * pango_ot_info_list_scripts (PangoOTInfo *info, PangoOTTableType table_type); PangoOTTag * pango_ot_info_list_languages (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag); PangoOTTag * pango_ot_info_list_features (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag tag, guint script_index, guint language_index); PangoOTBuffer * pango_ot_buffer_new (PangoFcFont *font); void pango_ot_buffer_destroy (PangoOTBuffer *buffer); void pango_ot_buffer_clear (PangoOTBuffer *buffer); void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer, guint glyph, guint properties, guint cluster); void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer, gboolean rtl); void pango_ot_buffer_set_zero_width_marks (PangoOTBuffer *buffer, gboolean zero_width_marks); void pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, PangoOTGlyph **glyphs, int *n_glyphs); void pango_ot_buffer_output (const PangoOTBuffer *buffer, PangoGlyphString *glyphs); const PangoOTRuleset * pango_ot_ruleset_get_for_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc); PangoOTRuleset * pango_ot_ruleset_new (PangoOTInfo *info); PangoOTRuleset * pango_ot_ruleset_new_for (PangoOTInfo *info, PangoScript script, PangoLanguage *language); PangoOTRuleset * pango_ot_ruleset_new_from_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc); void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, guint feature_index, gulong property_bit); gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, PangoOTTag feature_tag, gulong property_bit); guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, PangoOTTableType table_type, const PangoOTFeatureMap *features, guint n_features); guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset, guint *n_gsub_features, guint *n_gpos_features); void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer); void pango_ot_ruleset_position (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer); PangoOTRulesetDescription * pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc); gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, const PangoOTRulesetDescription *desc2); void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc); guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc); PangoOTTag pango_ot_tag_from_language (PangoLanguage *language); PangoOTTag pango_ot_tag_from_script (PangoScript script); PangoLanguage * pango_ot_tag_to_language (PangoOTTag language_tag); PangoScript pango_ot_tag_to_script (PangoOTTag script_tag);
Functions and macros in this section are used to implement the OpenType Layout features and algorithms. These are mostly useful when writing Fontconfig-based shaping engines
typedef guint32 PangoOTTag;
The PangoOTTag typedef is used to represent TrueType and OpenType
four letter tags inside Pango. Use PANGO_OT_TAG_MAKE()
or PANGO_OT_TAG_MAKE_FROM_STRING() macros to create PangoOTTags manually.
typedef struct _PangoOTInfo PangoOTInfo;
The PangoOTInfo struct contains the various
tables associated with an OpenType font. It contains only private fields and
should only be accessed via the pango_ot_info_* functions
which are documented below. To obtain a PangoOTInfo,
use pango_ot_info_new().
typedef struct _PangoOTBuffer PangoOTBuffer;
The PangoOTBuffer structure is used to store strings of glyphs associated
with a PangoFcFont, suitable for OpenType layout processing. It contains
only private fields and should only be accessed via the
pango_ot_buffer_* functions which are documented below.
To obtain a PangoOTBuffer, use pango_ot_buffer_new().
typedef struct {
guint32 glyph;
guint properties;
guint cluster;
gushort component;
gushort ligID;
guint internal;
} PangoOTGlyph;
The PangoOTGlyph structure represents a single glyph together with information used for OpenType layout processing of the glyph. It contains the following fields.
guint32 |
the glyph itself. |
guint |
the properties value, identifying which features should be
applied on this glyph. See pango_ruleset_add_feature().
|
guint |
the cluster that this glyph belongs to. |
gushort |
a component value, set by the OpenType layout engine. |
gushort |
a ligature index value, set by the OpenType layout engine. |
guint |
for Pango internal use |
typedef struct _PangoOTRuleset PangoOTRuleset;
The PangoOTRuleset structure holds a
set of features selected from the tables in an OpenType font.
(A feature is an operation such as adjusting glyph positioning
that should be applied to a text feature such as a certain
type of accent.) A PangoOTRuleset
is created with pango_ot_ruleset_new(), features are added
to it with pango_ot_ruleset_add_feature(), then it is
applied to a PangoGlyphString with pango_ot_ruleset_shape().
typedef struct {
PangoScript script;
PangoLanguage *language;
const PangoOTFeatureMap *static_gsub_features;
guint n_static_gsub_features;
const PangoOTFeatureMap *static_gpos_features;
guint n_static_gpos_features;
const PangoOTFeatureMap *other_features;
guint n_other_features;
} PangoOTRulesetDescription;
The PangoOTRuleset structure holds all the information needed
to build a complete PangoOTRuleset from an OpenType font.
The main use of this struct is to act as the key for a per-font
hash of rulesets. The user populates a ruleset description and
gets the ruleset using pango_ot_ruleset_get_for_description()
or create a new one using pango_ot_ruleset_new_from_description().
PangoScript |
a PangoScript. |
PangoLanguage * |
a PangoLanguage. |
const PangoOTFeatureMap * |
static map of GSUB features, or NULL.
|
guint |
length of static_gsub_features, or 0.
|
const PangoOTFeatureMap * |
static map of GPOS features, or NULL.
|
guint |
length of static_gpos_features, or 0.
|
const PangoOTFeatureMap * |
map of extra features to add to both GSUB and GPOS, or NULL.
Unlike the static maps, this pointer need not live beyond
the life of function calls taking this struct.
|
guint |
length of other_features, or 0.
|
Since 1.18
typedef enum
{
PANGO_OT_TABLE_GSUB,
PANGO_OT_TABLE_GPOS
} PangoOTTableType;
The PangoOTTableType enumeration values are used to
identify the various OpenType tables in the
pango_ot_info_* functions.
typedef struct {
char feature_name[5];
gulong property_bit;
} PangoOTFeatureMap;
The PangoOTFeatureMap typedef is used to represent an OpenType feature with the property bit associated with it. The feature tag is represented as a char array instead of a PangoOTTag for convenience.
char |
feature tag in represented as four-letter ASCII string. |
gulong |
the property bit to use for this feature. See
pango_ot_ruleset_add_feature() for details.
|
Since 1.18
#define PANGO_OT_TAG_MAKE(c1,c2,c3,c4) ((PangoOTTag) FT_MAKE_TAG (c1, c2, c3, c4))
Creates a PangoOTTag from four characters. This is similar and
compatible with the macro from
FreeType.
FT_MAKE_TAG()
|
First character. |
|
Second character. |
|
Third character. |
|
Fourth character. |
#define PANGO_OT_TAG_MAKE_FROM_STRING(s)
Creates a PangoOTTag from a string. The string should be at least
four characters long (pad with space characters if needed), and need
not be nul-terminated. This is a convenience wrapper around
PANGO_OT_TAG_MAKE(), but cannot be used in certain situations, for
example, as a switch expression, as it dereferences pointers.
|
The string representation of the tag. |
#define PANGO_OT_ALL_GLYPHS ((guint) 0xFFFF)
This is used as the property bit in pango_ot_ruleset_add_feature() when a
feature should be applied to all glyphs.
Since 1.16
#define PANGO_OT_NO_FEATURE ((guint) 0xFFFF)
This is used as a feature index that represent no feature, that is, should be
skipped. It may be returned as feature index by pango_ot_info_find_feature()
if the feature is not found, and pango_ot_rulset_add_feature() function
automatically skips this value, so no special handling is required by the
user.
Since 1.18
#define PANGO_OT_NO_SCRIPT ((guint) 0xFFFF)
This is used as a script index that represent no script, that is, when the
requested script was not found, and a default ('DFLT') script was not found
either. It may be returned as script index by pango_ot_info_find_script()
if the script or a default script are not found, all other functions
taking a script index essentially return if the input script index is
this value, so no special handling is required by the user.
Since 1.18
#define PANGO_OT_DEFAULT_LANGUAGE ((guint) 0xFFFF)
This is used as the language index in pango_ot_info_find_feature() when
the default language system of the script is desired.
It is also returned by pango_ot_info_find_language() if the requested language
is not found, or the requested language tag was PANGO_OT_TAG_DEFAULT_LANGUAGE.
The end result is that one can always call pango_ot_tag_from_language()
followed by pango_ot_info_find_language() and pass the result to
pango_ot_info_find_feature() without having to worry about falling back to
default language system explicitly.
Since 1.16
#define PANGO_OT_TAG_DEFAULT_LANGUAGE PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't')
This is a PangoOTTag representing a special language tag 'dflt'. It is
returned as language tag by pango_ot_tag_from_language() if the requested
language is not found. It is safe to pass this value to
pango_ot_info_find_language() as that function falls back to returning default
language-system if the requested language tag is not found.
Since 1.18
#define PANGO_OT_TAG_DEFAULT_SCRIPT PANGO_OT_TAG_MAKE ('D', 'F', 'L', 'T')
This is a PangoOTTag representing the special script tag 'DFLT'. It is
returned as script tag by pango_ot_tag_from_script() if the requested script
is not found.
Since 1.18
PangoOTInfo * pango_ot_info_get (FT_Face face);
Returns the PangoOTInfo structure for the given FreeType font face.
|
a FT_Face. |
Returns : |
the PangoOTInfo for face. This object will have
the same lifetime as face.
|
Since 1.2
gboolean pango_ot_info_find_script (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag script_tag, guint *script_index);
Finds the index of a script. If not found, tries to find the 'DFLT'
and then 'dflt' scripts and return the index of that in script_index.
If none of those is found either, PANGO_OT_NO_SCRIPT is placed in
script_index.
All other functions taking an input script_index parameter know
how to handle PANGO_OT_NO_SCRIPT, so one can ignore the return
value of this function completely and proceed, to enjoy the automatic
fallback to the 'DFLT'/'dflt' script.
|
a PangoOTInfo. |
|
the table type to obtain information about. |
|
the tag of the script to find. |
|
location to store the index of the script, or NULL.
|
Returns : |
TRUE if the script was found.
|
gboolean pango_ot_info_find_language (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag, guint *language_index, guint *required_feature_index);
Finds the index of a language and its required feature index.
If the language is not found, sets language_index to
PANGO_OT_DEFAULT_LANGUAGE and the required feature of the default language
system is returned in required_feature_index. For best compatibility with
some fonts, also searches the language system tag 'dflt' before falling
back to the default language system, but that is transparent to the user.
The user can simply ignore the return value of this function to
automatically fall back to the default language system.
|
a PangoOTInfo. |
|
the table type to obtain information about. |
|
the index of the script whose languages are searched. |
|
the tag of the language to find. |
|
location to store the index of the language, or NULL.
|
|
location to store the required feature index of
the language, or NULL.
|
Returns : |
TRUE if the language was found.
|
gboolean pango_ot_info_find_feature (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag feature_tag, guint script_index, guint language_index, guint *feature_index);
Finds the index of a feature. If the feature is not found, sets
feature_index to PANGO_OT_NO_FEATURE, which is safe to pass to
pango_ot_ruleset_add_feature() and similar functions.
In the future, this may set feature_index to an special value that if used
in pango_ot_ruleset_add_feature() will ask Pango to synthesize the
requested feature based on Unicode properties and data. However, this
function will still return FALSE in those cases. So, users may want to
ignore the return value of this function in certain cases.
|
a PangoOTInfo. |
|
the table type to obtain information about. |
|
the tag of the feature to find. |
|
the index of the script. |
|
the index of the language whose features are searched,
or PANGO_OT_DEFAULT_LANGUAGE to use the default language of the script.
|
|
location to store the index of the feature, or NULL.
|
Returns : |
TRUE if the feature was found.
|
PangoOTTag * pango_ot_info_list_scripts (PangoOTInfo *info, PangoOTTableType table_type);
Obtains the list of available scripts.
|
a PangoOTInfo. |
|
the table type to obtain information about. |
Returns : |
a newly-allocated zero-terminated array containing the tags of the
available scripts. Should be freed using g_free().
|
PangoOTTag * pango_ot_info_list_languages (PangoOTInfo *info, PangoOTTableType table_type, guint script_index, PangoOTTag language_tag);
Obtains the list of available languages for a given script.
|
a PangoOTInfo. |
|
the table type to obtain information about. |
|
the index of the script to list languages for. |
|
unused parameter. |
Returns : |
a newly-allocated zero-terminated array containing the tags of the
available languages. Should be freed using g_free().
|
PangoOTTag * pango_ot_info_list_features (PangoOTInfo *info, PangoOTTableType table_type, PangoOTTag tag, guint script_index, guint language_index);
Obtains the list of features for the given language of the given script.
|
a PangoOTInfo. |
|
the table type to obtain information about. |
|
unused parameter. |
|
the index of the script to obtain information about. |
|
the index of the language to list features for, or
PANGO_OT_DEFAULT_LANGUAGE, to list features for the default
language of the script.
|
Returns : |
a newly-allocated zero-terminated array containing the tags of the
available features. Should be freed using g_free().
|
PangoOTBuffer * pango_ot_buffer_new (PangoFcFont *font);
Creates a new PangoOTBuffer for the given OpenType font.
|
a PangoFcFont |
Returns : |
the newly allocated PangoOTBuffer, which should
be freed with pango_ot_buffer_destroy().
|
Since 1.4
void pango_ot_buffer_destroy (PangoOTBuffer *buffer);
Destroys a PangoOTBuffer and free all associated memory.
|
a PangoOTBuffer |
Since 1.4
void pango_ot_buffer_clear (PangoOTBuffer *buffer);
Empties a PangoOTBuffer, make it ready to add glyphs to.
|
a PangoOTBuffer |
Since 1.4
void pango_ot_buffer_add_glyph (PangoOTBuffer *buffer, guint glyph, guint properties, guint cluster);
Appends a glyph to a PangoOTBuffer, with properties identifying which
features should be applied on this glyph. See pango_ruleset_add_feature().
|
a PangoOTBuffer |
|
the glyph index to add, like a PangoGlyph |
|
the glyph properties |
|
the cluster that this glyph belongs to |
Since 1.4
void pango_ot_buffer_set_rtl (PangoOTBuffer *buffer, gboolean rtl);
Sets whether glyphs will be rendered right-to-left. This setting is needed for proper horizontal positioning of right-to-left scripts.
|
a PangoOTBuffer |
|
TRUE for right-to-left text
|
Since 1.4
void pango_ot_buffer_set_zero_width_marks
(PangoOTBuffer *buffer,
gboolean zero_width_marks);
Sets whether characters with a mark class should be forced to zero width. This setting is needed for proper positioning of Arabic accents, but will produce incorrect results with standard OpenType Indic fonts.
|
a PangoOTBuffer |
|
TRUE if characters with a mark class should
be forced to zero width.
|
Since 1.6
void pango_ot_buffer_get_glyphs (const PangoOTBuffer *buffer, PangoOTGlyph **glyphs, int *n_glyphs);
Gets the glyph array contained in a PangoOTBuffer. The glyphs are owned by the buffer and should not be freed, and are only valid as long as buffer is not modified.
|
a PangoOTBuffer |
|
location to store the array of glyphs, or NULL
|
|
location to store the number of glyphs, or NULL
|
Since 1.4
void pango_ot_buffer_output (const PangoOTBuffer *buffer, PangoGlyphString *glyphs);
Exports the glyphs in a PangoOTBuffer into a PangoGlyphString. This is typically used after the OpenType layout processing is over, to convert the resulting glyphs into a generic Pango glyph string.
|
a PangoOTBuffer |
|
a PangoGlyphString |
Since 1.4
const PangoOTRuleset * pango_ot_ruleset_get_for_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc);
Returns a ruleset for the given OpenType info and ruleset
description. Rulesets are created on demand using
pango_ot_ruleset_new_from_description().
The returned ruleset should not be modified or destroyed.
The static feature map members of desc should be alive as
long as info is.
|
a PangoOTInfo. |
|
a PangoOTRulesetDescription. |
Returns : |
the PangoOTRuleset for desc. This object will have
the same lifetime as info.
|
Since 1.18
PangoOTRuleset * pango_ot_ruleset_new (PangoOTInfo *info);
Creates a new PangoOTRuleset for the given OpenType info.
|
a PangoOTInfo. |
Returns : |
the newly allocated PangoOTRuleset, which
should be freed with g_object_unref().
|
PangoOTRuleset * pango_ot_ruleset_new_for (PangoOTInfo *info, PangoScript script, PangoLanguage *language);
Creates a new PangoOTRuleset for the given OpenType info, script, and language.
This function is part of a convenience scheme that highly simplifies using a PangoOTRuleset to represent features for a specific pair of script and language. So one can use this function passing in the script and language of interest, and later try to add features to the ruleset by just specifying the feature name or tag, without having to deal with finding script, language, or feature indices manually.
In excess to what pango_ot_ruleset_new() does, this function will:
script and language using pango_ot_tag_from_script() and
pango_ot_tag_from_language(),
PANGO_OT_TABLE_GSUB and PANGO_OT_TABLE_GPOS,
find the script index of the script tag found and the language
system index of the language tag found in that script system, using
pango_ot_info_find_script() and pango_ot_info_find_language(),
pango_ot_ruleset_add_feature(),
pango_ot_ruleset_maybe_add_feature() and
pango_ot_ruleset_maybe_add_features().
Because of the way return values of pango_ot_info_find_script() and
pango_ot_info_find_language() are ignored, this function automatically
finds and uses the 'DFLT' script and the default language-system.
|
a PangoOTInfo. |
|
a PangoScript. |
|
a PangoLanguage. |
Returns : |
the newly allocated PangoOTRuleset, which
should be freed with g_object_unref().
|
Since 1.18
PangoOTRuleset * pango_ot_ruleset_new_from_description (PangoOTInfo *info, const PangoOTRulesetDescription *desc);
Creates a new PangoOTRuleset for the given OpenType infor and matching the given ruleset description.
This is a convenience function that calls pango_ot_ruleset_new_for() and
adds the static GSUB/GPOS features to the resulting ruleset, followed by
adding other features to both GSUB and GPOS.
The static feature map members of desc should be alive as
long as info is.
|
a PangoOTInfo. |
|
a PangoOTRulesetDescription. |
Returns : |
the newly allocated PangoOTRuleset, which
should be freed with g_object_unref().
|
Since 1.18
void pango_ot_ruleset_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, guint feature_index, gulong property_bit);
Adds a feature to the ruleset.
|
a PangoOTRuleset. |
|
the table type to add a feature to. |
|
the index of the feature to add. |
|
the property bit to use for this feature. Used to identify
the glyphs that this feature should be applied to, or
PANGO_OT_ALL_GLYPHS if it should be applied to all glyphs.
|
gboolean pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset, PangoOTTableType table_type, PangoOTTag feature_tag, gulong property_bit);
This is a convenience function that first tries to find the feature
using pango_ot_info_find_feature() and the ruleset script and language
passed to pango_ot_ruleset_new_for(),
and if the feature is found, adds it to the ruleset.
If ruleset was not created using pango_ot_ruleset_new_for(), this function
does nothing.
|
a PangoOTRuleset. |
|
the table type to add a feature to. |
|
the tag of the feature to add. |
|
the property bit to use for this feature. Used to identify
the glyphs that this feature should be applied to, or
PANGO_OT_ALL_GLYPHS if it should be applied to all glyphs.
|
Returns : |
TRUE if the feature was found and added to ruleset,
FALSE otherwise.
|
Since 1.18
guint pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset, PangoOTTableType table_type, const PangoOTFeatureMap *features, guint n_features);
This is a convenience function that
for each feature in the feature map array features
converts the feature name to a PangoOTTag feature tag using PANGO_OT_TAG_MAKE()
and calls pango_ot_ruleset_maybe_add_feature() on it.
|
a PangoOTRuleset. |
|
the table type to add features to. |
|
array of feature name and property bits to add. |
|
number of feature records in features array.
|
Returns : |
The number of features in features that were found
and added to ruleset.
|
Since 1.18
guint pango_ot_ruleset_get_feature_count (const PangoOTRuleset *ruleset, guint *n_gsub_features, guint *n_gpos_features);
Gets the number of GSUB and GPOS features in the ruleset.
|
a PangoOTRuleset. |
|
location to store number of GSUB features, or NULL.
|
|
location to store number of GPOS features, or NULL.
|
Returns : |
Total number of features in the ruleset.
|
Since 1.18
void pango_ot_ruleset_substitute (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer);
Performs the OpenType GSUB substitution on buffer using the features
in ruleset
|
a PangoOTRuleset. |
|
a PangoOTBuffer. |
Since 1.4
void pango_ot_ruleset_position (const PangoOTRuleset *ruleset, PangoOTBuffer *buffer);
Performs the OpenType GPOS positioning on buffer using the features
in ruleset
|
a PangoOTRuleset. |
|
a PangoOTBuffer. |
Since 1.4
PangoOTRulesetDescription * pango_ot_ruleset_description_copy (const PangoOTRulesetDescription *desc);
Creates a copy of desc, which should be freed with
pango_ot_ruleset_description_free(). Primarily used internally
by pango_ot_ruleset_get_for_description() to cache rulesets for
ruleset descriptions.
|
ruleset description to copy |
Returns : |
the newly allocated PangoOTRulesetDescription, which
should be freed with pango_ot_ruleset_description_free().
|
Since 1.18
gboolean pango_ot_ruleset_description_equal (const PangoOTRulesetDescription *desc1, const PangoOTRulesetDescription *desc2);
Compares two ruleset descriptions for equality.
Two ruleset descriptions are considered equal if the rulesets
they describe are provably identical. This means that their
script, language, and all feature sets should be equal. For static feature
sets, the array addresses are compared directly, while for other
features, the list of features is compared one by one.
(Two ruleset descriptions may result in identical rulesets
being created, but still compare FALSE.)
|
a ruleset description |
|
a ruleset description |
Returns : |
TRUE if two ruleset descriptions are identical,
FALSE otherwise.
|
Since 1.18
void pango_ot_ruleset_description_free (PangoOTRulesetDescription *desc);
Frees a ruleset description allocated by
pango_ot_ruleset_description_copy().
|
an allocated PangoOTRulesetDescription |
Since 1.18
guint pango_ot_ruleset_description_hash (const PangoOTRulesetDescription *desc);
Computes a hash of a PangoOTRulesetDescription structure suitable
to be used, for example, as an argument to g_hash_table_new().
|
a ruleset description |
Returns : |
the hash value. |
Since 1.18
PangoOTTag pango_ot_tag_from_language (PangoLanguage *language);
Finds the OpenType language-system tag best describing language.
|
A PangoLanguage, or NULL
|
Returns : |
PangoOTTag best matching language or
PANGO_OT_TAG_DEFAULT_LANGUAGE if none found or if language
is NULL.
|
Since 1.18
PangoOTTag pango_ot_tag_from_script (PangoScript script);
Finds the OpenType script tag corresponding to script.
The PANGO_SCRIPT_COMMON, PANGO_SCRIPT_INHERITED, and
PANGO_SCRIPT_UNKNOWN scripts are mapped to the OpenType
'DFLT' script tag that is also defined as
PANGO_OT_TAG_DEFAULT_SCRIPT.
Note that multiple PangoScript values may map to the same
OpenType script tag. In particular, PANGO_SCRIPT_HIRAGANA
and PANGO_SCRIPT_KATAKANA both map to the OT tag 'kana'.
|
A PangoScript |
Returns : |
PangoOTTag corresponding to script or
PANGO_OT_TAG_DEFAULT_SCRIPT if none found.
|
Since 1.18
PangoLanguage * pango_ot_tag_to_language (PangoOTTag language_tag);
Finds a PangoLanguage corresponding to language_tag.
|
A PangoOTTag OpenType language-system tag |
Returns : |
PangoLanguage best matching language_tag or
PangoLanguage corresponding to the string "xx" if none found.
|
Since 1.18
PangoScript pango_ot_tag_to_script (PangoOTTag script_tag);
Finds the PangoScript corresponding to script_tag.
The 'DFLT' script tag is mapped to PANGO_SCRIPT_COMMON.
Note that an OpenType script tag may correspond to multiple
PangoScript values. In such cases, the PangoScript value
with the smallest value is returned.
In particular, PANGO_SCRIPT_HIRAGANA
and PANGO_SCRIPT_KATAKANA both map to the OT tag 'kana'.
This function will return PANGO_SCRIPT_HIRAGANA for
'kana'.
|
A PangoOTTag OpenType script tag |
Returns : |
PangoScript corresponding to script_tag or
PANGO_SCRIPT_UNKNOWN if none found.
|
Since 1.18
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#define PANGO_VERSION_ENCODE (major, minor, micro) #define PANGO_VERSION #define PANGO_VERSION_MAJOR #define PANGO_VERSION_MINOR #define PANGO_VERSION_MICRO #define PANGO_VERSION_STRING #define PANGO_VERSION_CHECK (major,minor,micro) int pango_version (void); const char * pango_version_string (void); const char * pango_version_check (int required_major, int required_minor, int required_micro);
The capital-letter macros defined here can be used to check the version of Pango at compile-time, and to encode Pango versions into integers. The functions can be used to check the version of the linked Pango library at run-time.
#define PANGO_VERSION_ENCODE(major, minor, micro)
This macro encodes the given Pango version into an integer. The numbers
returned by PANGO_VERSION and pango_version() are encoded using this macro.
Two encoded version numbers can be compared as integers.
|
the major component of the version number |
|
the minor component of the version number |
|
the micro component of the version number |
#define PANGO_VERSION
The version of Pango available at compile-time, encoded using
PANGO_VERSION_ENCODE().
#define PANGO_VERSION_MAJOR 1
The major component of the version of Pango available at compile-time.
#define PANGO_VERSION_MINOR 26
The minor component of the version of Pango available at compile-time.
#define PANGO_VERSION_MICRO 0
The micro component of the version of Pango available at compile-time.
#define PANGO_VERSION_STRING "1.26.0"
A string literal containing the version of Pango available at compile-time.
#define PANGO_VERSION_CHECK(major,minor,micro)
Checks that the version of Pango available at compile-time is not older than the provided version number.
|
the major component of the version number |
|
the minor component of the version number |
|
the micro component of the version number |
int pango_version (void);
This is similar to the macro PANGO_VERSION except that
it returns the encoded version of Pango available at run-time,
as opposed to the version available at compile-time.
A version number can be encoded into an integer using
PANGO_VERSION_ENCODE().
Returns : |
The encoded version of Pango library available at run time. |
Since 1.16
const char * pango_version_string (void);
This is similar to the macro PANGO_VERSION_STRING except that
it returns the version of Pango available at run-time, as opposed to
the version available at compile-time.
Returns : |
A string containing the version of Pango library available at run time. The returned string is owned by Pango and should not be modified or freed. |
Since 1.16
const char * pango_version_check (int required_major,
int required_minor,
int required_micro);
Checks that the Pango library in use is compatible with the
given version. Generally you would pass in the constants
PANGO_VERSION_MAJOR, PANGO_VERSION_MINOR, PANGO_VERSION_MICRO
as the three arguments to this function; that produces
a check that the library in use at run-time is compatible with
the version of Pango the application or module was compiled against.
Compatibility is defined by two things: first the version
of the running library is newer than the version
required_major.required_minor.required_micro. Second
the running library must be binary compatible with the
version required_major.required_minor.required_micro
(same major version.)
For compile-time version checking use PANGO_VERSION_CHECK().
|
the required major version. |
|
the required minor version. |
|
the required major version. |
Returns : |
NULL if the Pango library is compatible with the
given version, or a string describing the version mismatch.
The returned string is owned by Pango and should not be modified
or freed.
|
Since 1.16
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
FreeType Fonts and RenderingFreeType Fonts and Rendering — Functions for shape engines to manipulate FreeType fonts |
PangoFT2FontMap;
#define PANGO_RENDER_TYPE_FT2
PangoFontMap * pango_ft2_font_map_new (void);
void pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap,
double dpi_x,
double dpi_y);
PangoContext * pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap);
void (*PangoFT2SubstituteFunc) (FcPattern *pattern,
gpointer data);
void pango_ft2_font_map_set_default_substitute
(PangoFT2FontMap *fontmap,
PangoFT2SubstituteFunc func,
gpointer data,
GDestroyNotify notify);
void pango_ft2_font_map_substitute_changed
(PangoFT2FontMap *fontmap);
PangoContext * pango_ft2_get_context (double dpi_x,
double dpi_y);
void pango_ft2_render (FT_Bitmap *bitmap,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
void pango_ft2_render_transformed (FT_Bitmap *bitmap,
const PangoMatrix *matrix,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
void pango_ft2_render_layout_line (FT_Bitmap *bitmap,
PangoLayoutLine *line,
int x,
int y);
void pango_ft2_render_layout_line_subpixel
(FT_Bitmap *bitmap,
PangoLayoutLine *line,
int x,
int y);
void pango_ft2_render_layout (FT_Bitmap *bitmap,
PangoLayout *layout,
int x,
int y);
void pango_ft2_render_layout_subpixel (FT_Bitmap *bitmap,
PangoLayout *layout,
int x,
int y);
PangoGlyph pango_ft2_get_unknown_glyph (PangoFont *font);
int pango_ft2_font_get_kerning (PangoFont *font,
PangoGlyph left,
PangoGlyph right);
FT_Face pango_ft2_font_get_face (PangoFont *font);
PangoCoverage * pango_ft2_font_get_coverage (PangoFont *font,
PangoLanguage *language);
PangoFontMap * pango_ft2_font_map_for_display (void);
void pango_ft2_shutdown_display (void);
The macros and functions in this section are used to access fonts and render text to bitmaps using the FreeType 2 library.
typedef struct _PangoFT2FontMap PangoFT2FontMap;
The PangoFT2FontMap is the PangoFontMap implementation for FreeType fonts.
#define PANGO_RENDER_TYPE_FT2 "PangoRenderFT2"
PANGO_RENDER_TYPE_FT2 is deprecated and should not be used in newly-written code.
A string constant that was used to identify shape engines that work
with the FreeType backend. See PANGO_RENDER_TYPE_FC for the replacement.
PangoFontMap * pango_ft2_font_map_new (void);
Create a new PangoFT2FontMap object; a fontmap is used
to cache information about available fonts, and holds
certain global parameters such as the resolution and
the default substitute function (see
pango_ft2_font_map_set_default_substitute()).
Returns : |
the newly created fontmap object. Unref
with g_object_unref() when you are finished with it.
|
Since 1.2
void pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap, double dpi_x, double dpi_y);
Sets the horizontal and vertical resolutions for the fontmap.
|
a PangoFT2Fontmap |
|
dots per inch in the X direction |
|
dots per inch in the Y direction |
Since 1.2
PangoContext * pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap);
pango_ft2_font_map_create_context has been deprecated since version 1.22 and should not be used in newly-written code. Use pango_font_map_create_context() instead.
Create a PangoContext for the given fontmap.
|
a PangoFT2Fontmap |
Returns : |
the newly created context; free with g_object_unref().
|
Since 1.2
void (*PangoFT2SubstituteFunc) (FcPattern *pattern,
gpointer data);
Function type for doing final config tweaking on prepared FcPatterns.
|
the FcPattern to tweak. |
|
user data. |
void pango_ft2_font_map_set_default_substitute
(PangoFT2FontMap *fontmap,
PangoFT2SubstituteFunc func,
gpointer data,
GDestroyNotify notify);
Sets a function that will be called to do final configuration substitution on a FcPattern before it is used to load the font. This function can be used to do things like set hinting and antialiasing options.
|
a PangoFT2FontMap |
|
function to call to to do final config tweaking on FcPattern objects. |
|
data to pass to func
|
|
function to call when data is no longer used.
|
Since 1.2
void pango_ft2_font_map_substitute_changed
(PangoFT2FontMap *fontmap);
Call this function any time the results of the
default substitution function set with
pango_ft2_font_map_set_default_substitute() change.
That is, if your substitution function will return different
results for the same input pattern, you must call this function.
|
a PangoFT2Fontmap |
Since 1.2
PangoContext * pango_ft2_get_context (double dpi_x, double dpi_y);
pango_ft2_get_context has been deprecated since version 1.22 and should not be used in newly-written code. Use pango_font_map_create_context() instead.
Retrieves a PangoContext for the default PangoFT2 fontmap
(see pango_ft2_fontmap_get_for_display()) and sets the resolution
for the default fontmap to dpi_x by dpi_y.
|
the horizontal DPI of the target device |
|
the vertical DPI of the target device |
Returns : |
the new PangoContext |
void pango_ft2_render (FT_Bitmap *bitmap,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
Renders a PangoGlyphString onto a FreeType2 bitmap.
|
the FreeType2 bitmap onto which to draw the string |
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of the start of the string (in pixels) |
|
the y position of the baseline (in pixels) |
void pango_ft2_render_transformed (FT_Bitmap *bitmap,
const PangoMatrix *matrix,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
Renders a PangoGlyphString onto a FreeType2 bitmap, possibly
transforming the layed-out coordinates through a transformation
matrix. Note that the transformation matrix for font is not
changed, so to produce correct rendering results, the font
must have been loaded using a PangoContext with an identical
transformation matrix to that passed in to this function.
|
the FreeType2 bitmap onto which to draw the string |
|
a PangoMatrix, or NULL to use an identity transformation
|
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of the start of the string (in Pango units in user space coordinates) |
|
the y position of the baseline (in Pango units in user space coordinates) |
Since 1.6
void pango_ft2_render_layout_line (FT_Bitmap *bitmap,
PangoLayoutLine *line,
int x,
int y);
Render a PangoLayoutLine onto a FreeType2 bitmap
|
a FT_Bitmap to render the line onto |
|
a PangoLayoutLine |
|
the x position of start of string (in pixels) |
|
the y position of baseline (in pixels) |
void pango_ft2_render_layout_line_subpixel
(FT_Bitmap *bitmap,
PangoLayoutLine *line,
int x,
int y);
Render a PangoLayoutLine onto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels. (Using this will avoid extra inaccuracies from rounding to integer pixels multiple times, even if the final glyph positions are integers.)
|
a FT_Bitmap to render the line onto |
|
a PangoLayoutLine |
|
the x position of start of string (in Pango units) |
|
the y position of baseline (in Pango units) |
Since 1.6
void pango_ft2_render_layout (FT_Bitmap *bitmap,
PangoLayout *layout,
int x,
int y);
Render a PangoLayout onto a FreeType2 bitmap
|
a FT_Bitmap to render the layout onto |
|
a PangoLayout |
|
the X position of the left of the layout (in pixels) |
|
the Y position of the top of the layout (in pixels) |
void pango_ft2_render_layout_subpixel (FT_Bitmap *bitmap,
PangoLayout *layout,
int x,
int y);
Render a PangoLayout onto a FreeType2 bitmap, with he location specified in fixed-point Pango units rather than pixels. (Using this will avoid extra inaccuracies from rounding to integer pixels multiple times, even if the final glyph positions are integers.)
|
a FT_Bitmap to render the layout onto |
|
a PangoLayout |
|
the X position of the left of the layout (in Pango units) |
|
the Y position of the top of the layout (in Pango units) |
Since 1.6
PangoGlyph pango_ft2_get_unknown_glyph (PangoFont *font);
pango_ft2_get_unknown_glyph is deprecated and should not be used in newly-written code.
Return the index of a glyph suitable for drawing unknown characters with
font, or PANGO_GLYPH_EMPTY if no suitable glyph found.
If you want to draw an unknown-box for a character that is not covered
by the font,
use PANGO_GET_UNKNOWN_GLYPH() instead.
|
a PangoFont |
Returns : |
a glyph index into font, or PANGO_GLYPH_EMPTY
|
int pango_ft2_font_get_kerning (PangoFont *font, PangoGlyph left, PangoGlyph right);
pango_ft2_font_get_kerning is deprecated and should not be used in newly-written code.
Retrieves kerning information for a combination of two glyphs.
Use pango_fc_font_kern_glyphs() instead.
|
a PangoFont |
|
the left PangoGlyph |
|
the right PangoGlyph |
Returns : |
The amount of kerning (in Pango units) to apply for the given combination of glyphs. |
FT_Face pango_ft2_font_get_face (PangoFont *font);
pango_ft2_font_get_face is deprecated and should not be used in newly-written code.
Returns the native FreeType2 FT_Face structure used for this PangoFont. This may be useful if you want to use FreeType2 functions directly.
Use pango_fc_font_lock_face() instead; when you are done with a
face from pango_fc_font_lock_face() you must call
pango_fc_font_unlock_face().
PangoCoverage * pango_ft2_font_get_coverage (PangoFont *font, PangoLanguage *language);
pango_ft2_font_get_coverage is deprecated and should not be used in newly-written code.
Gets the PangoCoverage for a PangoFT2Font. Use
pango_font_get_coverage() instead.
|
a PangoFT2Font. |
|
a language tag. |
Returns : |
a PangoCoverage. |
PangoFontMap * pango_ft2_font_map_for_display (void);
pango_ft2_font_map_for_display is deprecated and should not be used in newly-written code.
Returns a PangoFT2FontMap. This font map is cached and should
not be freed. If the font map is no longer needed, it can
be released with pango_ft2_shutdown_display(). Use of the
global PangoFT2 fontmap is deprecated; use pango_ft2_font_map_new()
instead.
Returns : |
a PangoFT2FontMap. |
void pango_ft2_shutdown_display (void);
pango_ft2_shutdown_display is deprecated and should not be used in newly-written code.
Free the global fontmap. (See pango_ft2_font_map_for_display())
Use of the global PangoFT2 fontmap is deprecated.
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
PangoXftFont;
PangoXftFontMap;
#define PANGO_RENDER_TYPE_XFT
PangoContext * pango_xft_get_context (Display *display,
int screen);
PangoFontMap * pango_xft_get_font_map (Display *display,
int screen);
void pango_xft_set_default_substitute (Display *display,
int screen,
PangoXftSubstituteFunc func,
gpointer data,
GDestroyNotify notify);
void (*PangoXftSubstituteFunc) (FcPattern *pattern,
gpointer data);
void pango_xft_substitute_changed (Display *display,
int screen);
void pango_xft_shutdown_display (Display *display,
int screen);
XftFont * pango_xft_font_get_font (PangoFont *font);
Display * pango_xft_font_get_display (PangoFont *font);
gboolean pango_xft_font_has_char (PangoFont *font,
gunichar wc);
FT_Face pango_xft_font_lock_face (PangoFont *font);
void pango_xft_font_unlock_face (PangoFont *font);
guint pango_xft_font_get_glyph (PangoFont *font,
gunichar wc);
PangoGlyph pango_xft_font_get_unknown_glyph (PangoFont *font,
gunichar wc);
PangoXftRenderer;
PangoXftRendererClass;
PangoRenderer * pango_xft_renderer_new (Display *display,
int screen);
void pango_xft_renderer_set_draw (PangoXftRenderer *xftrenderer,
XftDraw *draw);
void pango_xft_renderer_set_default_color
(PangoXftRenderer *xftrenderer,
PangoColor *default_color);
void pango_xft_render (XftDraw *draw,
XftColor *color,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
void pango_xft_picture_render (Display *display,
Picture src_picture,
Picture dest_picture,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
void pango_xft_render_transformed (XftDraw *draw,
XftColor *color,
PangoMatrix *matrix,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
void pango_xft_render_layout_line (XftDraw *draw,
XftColor *color,
PangoLayoutLine *line,
int x,
int y);
void pango_xft_render_layout (XftDraw *draw,
XftColor *color,
PangoLayout *layout,
int x,
int y);
GObject +----PangoFont +----PangoFcFont +----PangoXftFont
GObject +----PangoFontMap +----PangoFcFontMap +----PangoXftFontMap
GObject +----PangoRenderer +----PangoXftRenderer
The Xft library is a library for displaying fonts on the X window system; internally it uses the fontconfig library to locate font files, and the FreeType library to load and render fonts. The Xft backend is the recommended Pango font backend for screen display with X. (The Cairo back end is another possibility.)
Using the Xft backend is generally straightforward;
pango_xft_get_context() creates a context for a specified display
and screen. You can then create a PangoLayout with that context
and render it with pango_xft_render_layout(). At a more advanced
level, the low-level fontconfig options used for rendering fonts
can be affected using pango_xft_set_default_substitute(), and
pango_xft_substitute_changed().
A range of functions for drawing pieces of a layout, such as individual layout lines and glyphs strings are provided. You can also directly create a PangoXftRenderer. Finally, in some advanced cases, it is useful to derive from PangoXftRenderer. Deriving from PangoXftRenderer is useful for two reasons. One reason is be to support custom attributes by overriding PangoRendererClass virtual functions like 'prepare_run' or 'draw_shape'. The reason is to customize exactly how the final bits are drawn to the destination by overriding the PangoXftRendererClass virtual functions 'composite_glyphs' and 'composite_trapezoids'.
typedef struct _PangoXftFont PangoXftFont;
PangoXftFont is an implementation of PangoFcFont using the Xft library for rendering. It is used in conjunction with PangoXftFontMap.
typedef struct _PangoXftFontMap PangoXftFontMap;
PangoXftFontMap is an implementation of PangoFcFontMap suitable for the Xft library as the renderer. It is used in to create fonts of type PangoXftFont.
#define PANGO_RENDER_TYPE_XFT "PangoRenderXft"
PANGO_RENDER_TYPE_XFT is deprecated and should not be used in newly-written code.
A string constant that was used to identify shape engines that work
with the Xft backend. See PANGO_RENDER_TYPE_FC for the replacement.
PangoContext * pango_xft_get_context (Display *display, int screen);
pango_xft_get_context has been deprecated since version 1.22 and should not be used in newly-written code. Use pango_xft_get_font_map() followed by
pango_font_map_create_context() instead.
Retrieves a PangoContext appropriate for rendering with Xft fonts on the given screen of the given display.
|
an X display. |
|
an X screen. |
Returns : |
the new PangoContext. |
PangoFontMap * pango_xft_get_font_map (Display *display, int screen);
Returns the PangoXftFontmap for the given display and screen. The fontmap is owned by Pango and will be valid until the display is closed.
|
an X display |
|
the screen number of a screen within display
|
Returns : |
a PangoFontMap object, owned by Pango. |
Since 1.2
void pango_xft_set_default_substitute (Display *display,
int screen,
PangoXftSubstituteFunc func,
gpointer data,
GDestroyNotify notify);
Sets a function that will be called to do final configuration substitution on a FcPattern before it is used to load the font. This function can be used to do things like set hinting and antialiasing options.
|
an X Display |
|
the screen number of a screen within display
|
|
function to call to to do final config tweaking on FcPattern objects. |
|
data to pass to func
|
|
function to call when data is no longer used.
|
Since 1.2
void (*PangoXftSubstituteFunc) (FcPattern *pattern,
gpointer data);
Function type for doing final config tweaking on prepared FcPatterns.
|
the FcPattern to tweak. |
|
user data. |
void pango_xft_substitute_changed (Display *display,
int screen);
Call this function any time the results of the
default substitution function set with
pango_xft_set_default_substitute() change.
That is, if your substitution function will return different
results for the same input pattern, you must call this function.
|
an X Display |
|
the screen number of a screen within display
|
Since 1.2
void pango_xft_shutdown_display (Display *display,
int screen);
Release any resources that have been cached for the
combination of display and screen. Note that when the
X display is closed, resources are released automatically,
without needing to call this function.
|
an X display |
|
the screen number of a screen within display
|
Since 1.2
XftFont * pango_xft_font_get_font (PangoFont *font);
Returns the XftFont of a font.
Display * pango_xft_font_get_display (PangoFont *font);
Returns the X display of the XftFont of a font.
|
a PangoFont. |
Returns : |
the X display of the XftFont associated to font.
|
gboolean pango_xft_font_has_char (PangoFont *font, gunichar wc);
pango_xft_font_has_char is deprecated and should not be used in newly-written code.
Determines whether font has a glyph for the codepoint wc.
Use pango_fc_font_has_char() instead.
|
a PangoFont for the Xft backend |
|
Unicode codepoint to look up |
Returns : |
TRUE if font has the requested codepoint.
|
Since 1.2
FT_Face pango_xft_font_lock_face (PangoFont *font);
pango_xft_font_lock_face is deprecated and should not be used in newly-written code.
Gets the FreeType FT_Face associated with a font,
This face will be kept around until you call
pango_xft_font_unlock_face().
Use pango_fc_font_lock_face() instead.
|
a PangoFont. |
Returns : |
the FreeType FT_Face associated with font.
|
Since 1.2
void pango_xft_font_unlock_face (PangoFont *font);
pango_xft_font_unlock_face is deprecated and should not be used in newly-written code.
Releases a font previously obtained with
pango_xft_font_lock_face().
Use pango_fc_font_unlock_face() instead.
|
a PangoFont. |
Since 1.2
guint pango_xft_font_get_glyph (PangoFont *font, gunichar wc);
pango_xft_font_get_glyph is deprecated and should not be used in newly-written code.
Gets the glyph index for a given Unicode character
for font. If you only want to determine
whether the font has the glyph, use pango_xft_font_has_char().
Use pango_fc_font_get_glyph() instead.
|
a PangoFont for the Xft backend |
|
Unicode codepoint to look up |
Returns : |
the glyph index, or 0, if the Unicode character does not exist in the font. |
Since 1.2
PangoGlyph pango_xft_font_get_unknown_glyph (PangoFont *font, gunichar wc);
pango_xft_font_get_unknown_glyph is deprecated and should not be used in newly-written code.
Returns the index of a glyph suitable for drawing wc as an
unknown character.
Use PANGO_GET_UNKNOWN_GLYPH() instead.
|
a PangoFont. |
|
the Unicode character for which a glyph is needed. |
Returns : |
a glyph index into font.
|
typedef struct _PangoXftRenderer PangoXftRenderer;
PangoXftRenderer is a subclass of PangoRenderer used for rendering with Pango's Xft backend. It can be used directly, or it can be further subclassed to modify exactly how drawing of individual elements occurs.
Since 1.8
typedef struct {
void (*composite_trapezoids) (PangoXftRenderer *xftrenderer,
PangoRenderPart part,
XTrapezoid *trapezoids,
int n_trapezoids);
void (*composite_glyphs) (PangoXftRenderer *xftrenderer,
XftFont *xft_font,
XftGlyphSpec *glyphs,
int n_glyphs);
} PangoXftRendererClass;
The class structure for PangoXftRenderer
|
draw the specified trapezoids using
the current color and other attributes for part
|
|
draw the specified glyphs using the current foreground color and other foreground attributes |
Since 1.8
PangoRenderer * pango_xft_renderer_new (Display *display, int screen);
Create a new PangoXftRenderer to allow rendering Pango objects
with the Xft library. You must call pango_xft_renderer_set_draw() before
using the renderer.
|
an X display |
|
the index of the screen for display to which rendering will be done
|
Returns : |
the newly created PangoXftRenderer, which should
be freed with g_object_unref().
|
Since 1.8
void pango_xft_renderer_set_draw (PangoXftRenderer *xftrenderer, XftDraw *draw);
Sets the XftDraw object that the renderer is drawing to. The renderer must not be currently active.
|
a PangoXftRenderer |
|
a XftDraw |
Since 1.8
void pango_xft_renderer_set_default_color
(PangoXftRenderer *xftrenderer,
PangoColor *default_color);
Sets the default foreground color for a XftRenderer.
|
a XftRenderer |
|
the default foreground color |
Since 1.8
void pango_xft_render (XftDraw *draw,
XftColor *color,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
Renders a PangoGlyphString onto an XftDraw object wrapping an X drawable.
|
the XftDraw object. |
|
the color in which to draw the string |
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of start of string (in pixels) |
|
the y position of baseline (in pixels) |
void pango_xft_picture_render (Display *display,
Picture src_picture,
Picture dest_picture,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
Renders a PangoGlyphString onto an Xrender Picture object.
|
an X display |
|
the source picture to draw the string with |
|
the destination picture to draw the string onto |
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of start of string (in pixels) |
|
the y position of baseline (in pixels) |
void pango_xft_render_transformed (XftDraw *draw,
XftColor *color,
PangoMatrix *matrix,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
Renders a PangoGlyphString onto a XftDraw, possibly
transforming the layed-out coordinates through a transformation
matrix. Note that the transformation matrix for font is not
changed, so to produce correct rendering results, the font
must have been loaded using a PangoContext with an identical
transformation matrix to that passed in to this function.
|
an XftDraw |
|
the color in which to draw the glyphs |
|
a PangoMatrix, or NULL to use an identity transformation
|
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of the start of the string (in Pango units in user space coordinates) |
|
the y position of the baseline (in Pango units in user space coordinates) |
Since 1.8
void pango_xft_render_layout_line (XftDraw *draw,
XftColor *color,
PangoLayoutLine *line,
int x,
int y);
Render a PangoLayoutLine onto a XftDraw
|
an XftDraw |
|
the foreground color in which to draw the layout line (may be overridden by color attributes) |
|
a PangoLayoutLine |
|
the x position of start of string (in Pango units) |
|
the y position of baseline (in Pango units) |
Since 1.8
void pango_xft_render_layout (XftDraw *draw,
XftColor *color,
PangoLayout *layout,
int x,
int y);
Render a PangoLayout onto a XftDraw
|
an XftDraw |
|
the foreground color in which to draw the layout (may be overridden by color attributes) |
|
a PangoLayout |
|
the X position of the left of the layout (in Pango units) |
|
the Y position of the top of the layout (in Pango units) |
Since 1.8
| Pango Reference Manual |
|---|
| Pango Reference Manual |
|---|
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
enum PangoScript; #define PANGO_TYPE_SCRIPT PangoScriptIter; PangoScript pango_script_for_unichar (gunichar ch); PangoLanguage * pango_script_get_sample_language (PangoScript script); PangoScriptIter * pango_script_iter_new (const char *text, int length); void pango_script_iter_get_range (PangoScriptIter *iter, G_CONST_RETURN char **start, G_CONST_RETURN char **end, PangoScript *script); gboolean pango_script_iter_next (PangoScriptIter *iter); void pango_script_iter_free (PangoScriptIter *iter); PangoLanguage; #define PANGO_TYPE_LANGUAGE PangoLanguage * pango_language_from_string (const char *language); const char * pango_language_to_string (PangoLanguage *language); gboolean pango_language_matches (PangoLanguage *language, const char *range_list); gboolean pango_language_includes_script (PangoLanguage *language, PangoScript script); const PangoScript * pango_language_get_scripts (PangoLanguage *language, int *num_scripts); PangoLanguage * pango_language_get_default (void); const char * pango_language_get_sample_string (PangoLanguage *language);
The functions in this section are used to identify the writing system, or script of individual characters and of ranges within a larger text string.
typedef enum { /* ISO 15924 code */
PANGO_SCRIPT_INVALID_CODE = -1,
PANGO_SCRIPT_COMMON = 0, /* Zyyy */
PANGO_SCRIPT_INHERITED, /* Qaai */
PANGO_SCRIPT_ARABIC, /* Arab */
PANGO_SCRIPT_ARMENIAN, /* Armn */
PANGO_SCRIPT_BENGALI, /* Beng */
PANGO_SCRIPT_BOPOMOFO, /* Bopo */
PANGO_SCRIPT_CHEROKEE, /* Cher */
PANGO_SCRIPT_COPTIC, /* Qaac */
PANGO_SCRIPT_CYRILLIC, /* Cyrl (Cyrs) */
PANGO_SCRIPT_DESERET, /* Dsrt */
PANGO_SCRIPT_DEVANAGARI, /* Deva */
PANGO_SCRIPT_ETHIOPIC, /* Ethi */
PANGO_SCRIPT_GEORGIAN, /* Geor (Geon, Geoa) */
PANGO_SCRIPT_GOTHIC, /* Goth */
PANGO_SCRIPT_GREEK, /* Grek */
PANGO_SCRIPT_GUJARATI, /* Gujr */
PANGO_SCRIPT_GURMUKHI, /* Guru */
PANGO_SCRIPT_HAN, /* Hani */
PANGO_SCRIPT_HANGUL, /* Hang */
PANGO_SCRIPT_HEBREW, /* Hebr */
PANGO_SCRIPT_HIRAGANA, /* Hira */
PANGO_SCRIPT_KANNADA, /* Knda */
PANGO_SCRIPT_KATAKANA, /* Kana */
PANGO_SCRIPT_KHMER, /* Khmr */
PANGO_SCRIPT_LAO, /* Laoo */
PANGO_SCRIPT_LATIN, /* Latn (Latf, Latg) */
PANGO_SCRIPT_MALAYALAM, /* Mlym */
PANGO_SCRIPT_MONGOLIAN, /* Mong */
PANGO_SCRIPT_MYANMAR, /* Mymr */
PANGO_SCRIPT_OGHAM, /* Ogam */
PANGO_SCRIPT_OLD_ITALIC, /* Ital */
PANGO_SCRIPT_ORIYA, /* Orya */
PANGO_SCRIPT_RUNIC, /* Runr */
PANGO_SCRIPT_SINHALA, /* Sinh */
PANGO_SCRIPT_SYRIAC, /* Syrc (Syrj, Syrn, Syre) */
PANGO_SCRIPT_TAMIL, /* Taml */
PANGO_SCRIPT_TELUGU, /* Telu */
PANGO_SCRIPT_THAANA, /* Thaa */
PANGO_SCRIPT_THAI, /* Thai */
PANGO_SCRIPT_TIBETAN, /* Tibt */
PANGO_SCRIPT_CANADIAN_ABORIGINAL, /* Cans */
PANGO_SCRIPT_YI, /* Yiii */
PANGO_SCRIPT_TAGALOG, /* Tglg */
PANGO_SCRIPT_HANUNOO, /* Hano */
PANGO_SCRIPT_BUHID, /* Buhd */
PANGO_SCRIPT_TAGBANWA, /* Tagb */
/* Unicode-4.0 additions */
PANGO_SCRIPT_BRAILLE, /* Brai */
PANGO_SCRIPT_CYPRIOT, /* Cprt */
PANGO_SCRIPT_LIMBU, /* Limb */
PANGO_SCRIPT_OSMANYA, /* Osma */
PANGO_SCRIPT_SHAVIAN, /* Shaw */
PANGO_SCRIPT_LINEAR_B, /* Linb */
PANGO_SCRIPT_TAI_LE, /* Tale */
PANGO_SCRIPT_UGARITIC, /* Ugar */
/* Unicode-4.1 additions */
PANGO_SCRIPT_NEW_TAI_LUE, /* Talu */
PANGO_SCRIPT_BUGINESE, /* Bugi */
PANGO_SCRIPT_GLAGOLITIC, /* Glag */
PANGO_SCRIPT_TIFINAGH, /* Tfng */
PANGO_SCRIPT_SYLOTI_NAGRI, /* Sylo */
PANGO_SCRIPT_OLD_PERSIAN, /* Xpeo */
PANGO_SCRIPT_KHAROSHTHI, /* Khar */
/* Unicode-5.0 additions */
PANGO_SCRIPT_UNKNOWN, /* Zzzz */
PANGO_SCRIPT_BALINESE, /* Bali */
PANGO_SCRIPT_CUNEIFORM, /* Xsux */
PANGO_SCRIPT_PHOENICIAN, /* Phnx */
PANGO_SCRIPT_PHAGS_PA, /* Phag */
PANGO_SCRIPT_NKO, /* Nkoo */
/* Unicode-5.1 additions */
PANGO_SCRIPT_KAYAH_LI, /* Kali */
PANGO_SCRIPT_LEPCHA, /* Lepc */
PANGO_SCRIPT_REJANG, /* Rjng */
PANGO_SCRIPT_SUNDANESE, /* Sund */
PANGO_SCRIPT_SAURASHTRA, /* Saur */
PANGO_SCRIPT_CHAM, /* Cham */
PANGO_SCRIPT_OL_CHIKI, /* Olck */
PANGO_SCRIPT_VAI, /* Vaii */
PANGO_SCRIPT_CARIAN, /* Cari */
PANGO_SCRIPT_LYCIAN, /* Lyci */
PANGO_SCRIPT_LYDIAN /* Lydi */
} PangoScript;
The PangoScript enumeration identifies different writing systems. The values correspond to the names as defined in the Unicode standard. Note that new types may be added in the future. Applications should be ready to handle unknown values. This enumeration is interchangeable with GUnicodeScript. See Unicode Standard Annex #24: Script names.
a value never returned from pango_script_for_unichar()
|
|
| a character used by multiple different scripts | |
| a mark glyph that takes its script from the base glyph to which it is attached | |
| Arabic | |
| Armenian | |
| Bengali | |
| Bopomofo | |
| Cherokee | |
| Coptic | |
| Cyrillic | |
| Deseret | |
| Devanagari | |
| Ethiopic | |
| Georgian | |
| Gothic | |
| Greek | |
| Gujarati | |
| Gurmukhi | |
| Han | |
| Hangul | |
| Hebrew | |
| Hiragana | |
| Kannada | |
| Katakana | |
| Khmer | |
| Lao | |
| Latin | |
| Malayalam | |
| Mongolian | |
| Myanmar | |
| Ogham | |
| Old Italic | |
| Oriya | |
| Runic | |
| Sinhala | |
| Syriac | |
| Tamil | |
| Telugu | |
| Thaana | |
| Thai | |
| Tibetan | |
| Canadian Aboriginal | |
| Yi | |
| Tagalog | |
| Hanunoo | |
| Buhid | |
| Tagbanwa | |
| Braille | |
| Cypriot | |
| Limbu | |
| Osmanya | |
| Shavian | |
| Linear B | |
| Tai Le | |
| Ugaritic | |
| New Tai Lue. Since 1.10 | |
| Buginese. Since 1.10 | |
| Glagolitic. Since 1.10 | |
| Tifinagh. Since 1.10 | |
| Syloti Nagri. Since 1.10 | |
| Old Persian. Since 1.10 | |
| Kharoshthi. Since 1.10 | |
| an unassigned code point. Since 1.14 | |
| Balinese. Since 1.14 | |
| Cuneiform. Since 1.14 | |
| Phoenician. Since 1.14 | |
| Phags-pa. Since 1.14 | |
| N'Ko. Since 1.14 | |
| Kayah Li. Since 1.20.1 | |
| Lepcha. Since 1.20.1 | |
| Rejang. Since 1.20.1 | |
| Sundanese. Since 1.20.1 | |
| Saurashtra. Since 1.20.1 | |
| Cham. Since 1.20.1 | |
| Ol Chiki. Since 1.20.1 | |
| Vai. Since 1.20.1 | |
| Carian. Since 1.20.1 | |
| Lycian. Since 1.20.1 | |
| Lydian. Since 1.20.1 |
#define PANGO_TYPE_SCRIPT (pango_script_get_type())
The GObject type for PangoScript
typedef struct _PangoScriptIter PangoScriptIter;
A PangoScriptIter is used to iterate through a string and identify ranges in different scripts.
PangoScript pango_script_for_unichar (gunichar ch);
Looks up the PangoScript for a particular character (as defined by
Unicode Standard Annex 24). No check is made for ch being a
valid Unicode character; if you pass in invalid character, the
result is undefined.
As of Pango 1.18, this function simply returns the return value of
g_unichar_get_script().
|
a Unicode character |
Returns : |
the PangoScript for the character. |
Since 1.4
PangoLanguage * pango_script_get_sample_language (PangoScript script);
Given a script, finds a language tag that is reasonably
representative of that script. This will usually be the
most widely spoken or used language written in that script:
for instance, the sample language for PANGO_SCRIPT_CYRILLIC
is ru (Russian), the sample language
for PANGO_SCRIPT_ARABIC is ar.
For some
scripts, no sample language will be returned because there
is no language that is sufficiently representative. The best
example of this is PANGO_SCRIPT_HAN, where various different
variants of written Chinese, Japanese, and Korean all use
significantly different sets of Han characters and forms
of shared characters. No sample language can be provided
for many historical scripts as well.
As of 1.18, this function checks the environment variables
PANGO_LANGUAGE and LANGUAGE (checked in that order) first.
If one of them is set, it is parsed as a list of language tags
separated by colons or other separators. This function
will return the first language in the parsed list that Pango
believes may use script for writing. This last predicate
is tested using pango_language_includes_script(). This can
be used to control Pango's font selection for non-primary
languages. For example, a PANGO_LANGUAGE enviroment variable
set to "en:fa" makes Pango choose fonts suitable for Persian (fa)
instead of Arabic (ar) when a segment of Arabic text is found
in an otherwise non-Arabic text. The same trick can be used to
choose a default language for PANGO_SCRIPT_HAN when setting
context language is not feasible.
|
a PangoScript |
Returns : |
a PangoLanguage that is representative
of the script, or NULL if no such language exists.
|
Since 1.4
PangoScriptIter * pango_script_iter_new (const char *text, int length);
Create a new PangoScriptIter, used to break a string of
Unicode into runs by text. No copy is made of text, so
the caller needs to make sure it remains valid until
the iterator is freed with pango_script_iter_free().
|
a UTF-8 string |
|
length of text, or -1 if text is nul-terminated.
|
Returns : |
the new script iterator, initialized
to point at the first range in the text, which should be
freed with pango_script_iter_free(). If the string is
empty, it will point at an empty range.
|
Since 1.4
void pango_script_iter_get_range (PangoScriptIter *iter, G_CONST_RETURN char **start, G_CONST_RETURN char **end, PangoScript *script);
Gets information about the range to which iter currently points.
The range is the set of locations p where *start <= p < *end.
(That is, it doesn't include the character stored at *end)
|
a PangoScriptIter |
|
location to store start position of the range, or NULL
|
|
location to store end position of the range, or NULL
|
|
location to store script for range, or NULL
|
Since 1.4
gboolean pango_script_iter_next (PangoScriptIter *iter);
Advances a PangoScriptIter to the next range. If iter
is already at the end, it is left unchanged and FALSE
is returned.
|
a PangoScriptIter |
Returns : |
TRUE if iter was successfully advanced.
|
Since 1.4
void pango_script_iter_free (PangoScriptIter *iter);
Frees a PangoScriptIter created with pango_script_iter_new().
|
a PangoScriptIter |
Since 1.4
typedef struct _PangoLanguage PangoLanguage;
The PangoLanguage structure is used to represent a language.
PangoLanguage pointers can be efficiently copied and compared with each other.
#define PANGO_TYPE_LANGUAGE (pango_language_get_type ())
The GObject type for PangoLanguage.
PangoLanguage * pango_language_from_string (const char *language);
Take a RFC-3066 format language tag as a string and convert it to a PangoLanguage pointer that can be efficiently copied (copy the pointer) and compared with other language tags (compare the pointer.)
This function first canonicalizes the string by converting it to lowercase, mapping '_' to '-', and stripping all characters other than letters and '-'.
Use pango_language_get_default() if you want to get the PangoLanguage for
the current locale of the process.
|
a string representing a language tag, or NULL
|
Returns : |
an opaque pointer to a PangoLanguage structure, or NULL
if language was NULL. The returned pointer will be valid
forever after, and should not be freed.
|
const char * pango_language_to_string (PangoLanguage *language);
Gets the RFC-3066 format string representing the given language tag.
|
a language tag. |
Returns : |
a string representing the language tag. This is owned by Pango and should not be freed. |
gboolean pango_language_matches (PangoLanguage *language, const char *range_list);
Checks if a language tag matches one of the elements in a list of language ranges. A language tag is considered to match a range in the list if the range is '*', the range is exactly the tag, or the range is a prefix of the tag, and the character after it in the tag is '-'.
|
a language tag (see pango_language_from_string()),
NULL is allowed and matches nothing but '*'
|
|
a list of language ranges, separated by ';', ':',
',', or space characters.
Each element must either be '*', or a RFC 3066 language range
canonicalized as by pango_language_from_string()
|
Returns : |
TRUE if a match was found.
|
gboolean pango_language_includes_script (PangoLanguage *language, PangoScript script);
Determines if script is one of the scripts used to
write language. The returned value is conservative;
if nothing is known about the language tag language,
TRUE will be returned, since, as far as Pango knows,
script might be used to write language.
This routine is used in Pango's itemization process when determining if a supplied language tag is relevant to a particular section of text. It probably is not useful for applications in most circumstances.
This function uses pango_language_get_scripts() internally.
|
a PangoLanguage, or NULL
|
|
a PangoScript |
Returns : |
TRUE if script is one of the scripts used
to write language or if nothing is known about language
(including the case that language is NULL),
FALSE otherwise.
|
Since 1.4
const PangoScript * pango_language_get_scripts (PangoLanguage *language, int *num_scripts);
Determines the scripts used to to write language.
If nothing is known about the language tag language,
or if language is NULL, then NULL is returned.
The list of scripts returned starts with the script that the
language uses most and continues to the one it uses least.
The value num_script points at will be set to the number
of scripts in the returned array (or zero if NULL is returned).
Most languages use only one script for writing, but there are
some that use two (Latin and Cyrillic for example), and a few
use three (Japanese for example). Applications should not make
any assumptions on the maximum number of scripts returned
though, except that it is positive if the return value is not
NULL, and it is a small number.
The pango_language_includes_script() function uses this function
internally.
|
a PangoLanguage, or NULL
|
|
location to return number of scripts, or NULL
|
Returns : |
An array of PangoScript values, with the
number of entries in the array stored in num_scripts, or
NULL if Pango does not have any information about this
particular language tag (also the case if language is NULL).
The returned array is owned by Pango and should not be modified
or freed.
|
Since 1.22
PangoLanguage * pango_language_get_default (void);
Returns the PangoLanguage for the current locale of the process. Note that this can change over the life of an application.
On Unix systems, this is the return value is derived from
setlocale(LC_CTYPE, NULL), and the user can
affect this through the environment variables LC_ALL, LC_CTYPE or
LANG (checked in that order). The locale string typically is in
the form lang_COUNTRY, where lang is an ISO-639 language code, and
COUNTRY is an ISO-3166 country code. For instance, sv_FI for
Swedish as written in Finland or pt_BR for Portuguese as written in
Brazil.
On Windows, the C library does not use any such environment
variables, and setting them won't affect the behavior of functions
like ctime(). The user sets the locale through the Regional Options
in the Control Panel. The C library (in the setlocale() function)
does not use country and language codes, but country and language
names spelled out in English.
However, this function does check the above environment
variables, and does return a Unix-style locale string based on
either said environment variables or the thread's current locale.
Your application should call setlocale(LC_ALL, "");
for the user settings to take effect. Gtk+ does this in its initialization
functions automatically (by calling gtk_set_locale()).
See man setlocale for more details.
Returns : |
the default language as a PangoLanguage, must not be freed. |
Since 1.16
const char * pango_language_get_sample_string (PangoLanguage *language);
Get a string that is representative of the characters needed to render a particular language.
The sample text may be a pangram, but is not necessarily. It is chosen to be demonstrative of normal text in the language, as well as exposing font feature requirements unique to the language. It is suitable for use as sample text in a font selection dialog.
If language is NULL, the default language as found by
pango_language_get_default() is used.
If Pango does not have a sample string for language, the classic
"The quick brown fox..." is returned. This can be detected by
comparing the returned pointer value to that returned for (non-existent)
language code "xx". That is, compare to:
pango_language_get_sample_string (pango_language_from_string ("xx"))
|
a PangoLanguage, or NULL
|
Returns : |
the sample string. This value is owned by Pango and should not be freed. |
| Pango Reference Manual |
|---|
| Pango Reference Manual |
|---|
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
Win32 Fonts and RenderingWin32 Fonts and Rendering — Functions for shape engines to manipulate Win32 fonts |
#define PANGO_RENDER_TYPE_WIN32 PangoContext * pango_win32_get_context (void); void pango_win32_render (HDC hdc, PangoFont *font, PangoGlyphString *glyphs, gint x, gint y); void pango_win32_render_transformed (HDC hdc, const PangoMatrix *matrix, PangoFont *font, PangoGlyphString *glyphs, int x, int y); void pango_win32_render_layout_line (HDC hdc, PangoLayoutLine *line, int x, int y); void pango_win32_render_layout (HDC hdc, PangoLayout *layout, int x, int y); PangoGlyph pango_win32_get_unknown_glyph (PangoFont *font, gunichar wc); gint pango_win32_font_get_glyph_index (PangoFont *font, gunichar wc); gboolean pango_win32_font_select_font (PangoFont *font, HDC hdc); void pango_win32_font_done_font (PangoFont *font); double pango_win32_font_get_metrics_factor (PangoFont *font); gboolean pango_win32_get_debug_flag (void); HDC pango_win32_get_dc (void); PangoWin32FontCache; PangoWin32FontCache * pango_win32_font_cache_new (void); void pango_win32_font_cache_free (PangoWin32FontCache *cache); HFONT pango_win32_font_cache_load (PangoWin32FontCache *cache, const LOGFONTA *logfont); HFONT pango_win32_font_cache_loadw (PangoWin32FontCache *cache, const LOGFONTW *logfont); void pango_win32_font_cache_unload (PangoWin32FontCache *cache, HFONT hfont); PangoFontMap * pango_win32_font_map_for_display (void); void pango_win32_shutdown_display (void); PangoWin32FontCache * pango_win32_font_map_get_font_cache (PangoFontMap *font_map); LOGFONTA * pango_win32_font_logfont (PangoFont *font); LOGFONTW * pango_win32_font_logfontw (PangoFont *font); PangoFontDescription * pango_win32_font_description_from_logfont (const LOGFONTA *lfp); PangoFontDescription * pango_win32_font_description_from_logfontw (const LOGFONTW *lfp);
The macros and functions in this section are used to access fonts natively on Win32 systems and to render text in conjunction with Win32 APIs.
#define PANGO_RENDER_TYPE_WIN32 "PangoRenderWin32"
A string constant identifying the Win32 renderer. The associated quark (see
g_quark_from_string()) is used to identify the renderer in pango_find_map().
PangoContext * pango_win32_get_context (void);
pango_win32_get_context has been deprecated since version 1.22 and should not be used in newly-written code. Use pango_win32_font_map_for_display() followed by
pango_font_map_create_context() instead.
Retrieves a PangoContext appropriate for rendering with Windows fonts.
Returns : |
the new PangoContext |
void pango_win32_render (HDC hdc,
PangoFont *font,
PangoGlyphString *glyphs,
gint x,
gint y);
Render a PangoGlyphString onto a Windows DC
|
the device context |
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of start of string (in pixels) |
|
the y position of baseline (in pixels) |
void pango_win32_render_transformed (HDC hdc,
const PangoMatrix *matrix,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
Renders a PangoGlyphString onto a windows DC, possibly
transforming the layed-out coordinates through a transformation
matrix. Note that the transformation matrix for font is not
changed, so to produce correct rendering results, the font
must have been loaded using a PangoContext with an identical
transformation matrix to that passed in to this function.
|
a windows device context |
|
a PangoMatrix, or NULL to use an identity transformation
|
|
the font in which to draw the string |
|
the glyph string to draw |
|
the x position of the start of the string (in Pango units in user space coordinates) |
|
the y position of the baseline (in Pango units in user space coordinates) |
void pango_win32_render_layout_line (HDC hdc,
PangoLayoutLine *line,
int x,
int y);
Render a PangoLayoutLine onto a device context. For underlining to work property the text alignment of the DC should have TA_BASELINE and TA_LEFT.
|
DC to use for uncolored drawing |
|
a PangoLayoutLine |
|
the x position of start of string (in pixels) |
|
the y position of baseline (in pixels) |
void pango_win32_render_layout (HDC hdc,
PangoLayout *layout,
int x,
int y);
Render a PangoLayoutLine onto an X drawable
|
HDC to use for uncolored drawing |
|
a PangoLayout |
|
the X position of the left of the layout (in pixels) |
|
the Y position of the top of the layout (in pixels) |
PangoGlyph pango_win32_get_unknown_glyph (PangoFont *font, gunichar wc);
pango_win32_get_unknown_glyph is deprecated and should not be used in newly-written code.
Returns the index of a glyph suitable for drawing wc as an
unknown character.
Use PANGO_GET_UNKNOWN_GLYPH() instead.
|
a PangoFont |
|
the Unicode character for which a glyph is needed. |
Returns : |
a glyph index into font
|
gint pango_win32_font_get_glyph_index (PangoFont *font, gunichar wc);
Obtains the index of the glyph for wc in font, or 0, if not
covered.
|
a PangoFont. |
|
a Unicode character. |
Returns : |
the glyph index for wc.
|
gboolean pango_win32_font_select_font (PangoFont *font, HDC hdc);
Selects the font into the specified DC and changes the mapping mode
and world transformation of the DC appropriately for the font.
You may want to surround the use of this function with calls
to SaveDC() and RestoreDC(). Call pango_win32_font_done_font() when
you are done using the DC to release allocated resources.
See pango_win32_font_get_metrics_factor() for information about
converting from the coordinate space used by this function
into Pango units.
void pango_win32_font_done_font (PangoFont *font);
Releases any resources allocated by pango_win32_font_done_font()
|
a PangoFont from the win32 backend |
double pango_win32_font_get_metrics_factor (PangoFont *font);
Returns the scale factor from logical units in the coordinate
space used by pango_win32_font_select_font() to Pango units
in user space.
|
a PangoFont from the win32 backend |
Returns : |
factor to multiply logical units by to get Pango units. |
gboolean pango_win32_get_debug_flag (void);
Returns whether debugging is turned on.
Returns : |
TRUE if debugging is turned on.
|
Since 1.2
HDC pango_win32_get_dc (void);
Obtains a handle to the Windows device context that is used by Pango.
Returns : |
A handle to the Windows device context that is used by Pango. |
typedef struct _PangoWin32FontCache PangoWin32FontCache;
A PangoWin32FontCache caches HFONTs by their LOGFONT descriptions.
PangoWin32FontCache * pango_win32_font_cache_new (void);
Creates a font cache.
Returns : |
The new font cache. This must be freed with
pango_win32_font_cache_free().
|
void pango_win32_font_cache_free (PangoWin32FontCache *cache);
Frees a PangoWin32FontCache and all associated memory. All fonts loaded through this font cache will be freed along with the cache.
|
a PangoWin32FontCache |
HFONT pango_win32_font_cache_load (PangoWin32FontCache *cache, const LOGFONTA *logfont);
Creates a HFONT from a LOGFONTA. The result may be newly loaded, or it may have been previously stored
|
a PangoWin32FontCache |
|
a pointer to a LOGFONTA structure describing the font to load. |
Returns : |
The font structure, or NULL if the font could
not be loaded. In order to free this structure, you must call
pango_win32_font_cache_unload().
|
HFONT pango_win32_font_cache_loadw (PangoWin32FontCache *cache, const LOGFONTW *logfont);
Creates a HFONT from a LOGFONTW. The result may be newly loaded, or it may have been previously stored
|
a PangoWin32FontCache |
|
a pointer to a LOGFONTW structure describing the font to load. |
Returns : |
The font structure, or NULL if the font could
not be loaded. In order to free this structure, you must call
pango_win32_font_cache_unload().
|
Since 1.16
void pango_win32_font_cache_unload (PangoWin32FontCache *cache, HFONT hfont);
Frees a font structure previously loaded with pango_win32_font_cache_load().
|
a PangoWin32FontCache |
|
the HFONT to unload |
PangoFontMap * pango_win32_font_map_for_display (void);
Returns a PangoWin32FontMap. Font maps are cached and should
not be freed. If the font map is no longer needed, it can
be released with pango_win32_shutdown_display().
Returns : |
a PangoFontMap. |
PangoWin32FontCache * pango_win32_font_map_get_font_cache (PangoFontMap *font_map);
Obtains the font cache associated with the given font map.
|
a PangoWin32FontMap. |
Returns : |
the PangoWin32FontCache of font_map.
|
LOGFONTA * pango_win32_font_logfont (PangoFont *font);
Determine the LOGFONTA struct for the specified font. Note that
Pango internally uses LOGFONTW structs, so if converting the UTF-16
face name in the LOGFONTW struct to system codepage fails, the
returned LOGFONTA will have an emppty face name. To get the
LOGFONTW of a PangoFont, use pango_win32_font_logfontw(). It
is recommended to do that always even if you don't expect
to come across fonts with odd names.
LOGFONTW * pango_win32_font_logfontw (PangoFont *font);
Determine the LOGFONTW struct for the specified font.
|
a PangoFont which must be from the Win32 backend |
Returns : |
A newly allocated LOGFONTW struct. It must be
freed with g_free().
|
Since 1.16
PangoFontDescription * pango_win32_font_description_from_logfont (const LOGFONTA *lfp);
Creates a PangoFontDescription that matches the specified LOGFONTA.
The face name, italicness and weight fields in the LOGFONTA are used
to set up the resulting PangoFontDescription. If the face name in
the LOGFONTA contains non-ASCII characters the font is temporarily
loaded (using CreateFontIndirect()) and an ASCII (usually English)
name for it is looked up from the font name tables in the font
data. If that doesn't work, the face name is converted from the
system codepage to UTF-8 and that is used.
|
a LOGFONTA |
Returns : |
the newly allocated PangoFontDescription, which
should be freed using pango_font_description_free()
|
Since 1.12
PangoFontDescription * pango_win32_font_description_from_logfontw (const LOGFONTW *lfp);
Creates a PangoFontDescription that matches the specified LOGFONTW.
The face name, italicness and weight fields in the LOGFONTW are used
to set up the resulting PangoFontDescription. If the face name in
the LOGFONTW contains non-ASCII characters the font is temporarily
loaded (using CreateFontIndirect()) and an ASCII (usually English)
name for it is looked up from the font name tables in the font
data. If that doesn't work, the face name is converted from UTF-16
to UTF-8 and that is used.
|
a LOGFONTW |
Returns : |
the newly allocated PangoFontDescription, which
should be freed using pango_font_description_free()
|
Since 1.16
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
char ** pango_split_file_list (const char *str); char * pango_trim_string (const char *str); gint pango_read_line (FILE *stream, GString *str); gboolean pango_skip_space (const char **pos); gboolean pango_scan_word (const char **pos, GString *out); gboolean pango_scan_string (const char **pos, GString *out); gboolean pango_scan_int (const char **pos, int *out); char * pango_config_key_get (const char *key); void pango_lookup_aliases (const char *fontname, char ***families, int *n_families); gboolean pango_parse_enum (GType type, const char *str, int *value, gboolean warn, char **possible_values); gboolean pango_parse_style (const char *str, PangoStyle *style, gboolean warn); gboolean pango_parse_variant (const char *str, PangoVariant *variant, gboolean warn); gboolean pango_parse_weight (const char *str, PangoWeight *weight, gboolean warn); gboolean pango_parse_stretch (const char *str, PangoStretch *stretch, gboolean warn); const char * pango_get_sysconf_subdirectory (void); const char * pango_get_lib_subdirectory (void); guint8 * pango_log2vis_get_embedding_levels (const gchar *text, int length, PangoDirection *pbase_dir); gboolean pango_is_zero_width (gunichar ch); void pango_quantize_line_geometry (int *thickness, int *position);
The functions and utilities in this section are mostly used from Pango backends and modules, but may be useful for other purposes too.
char ** pango_split_file_list (const char *str);
Splits a G_SEARCHPATH_SEPARATOR-separated list of files, stripping
white space and substituting ~/ with $HOME/.
|
a G_SEARCHPATH_SEPARATOR separated list of filenames
|
Returns : |
a list of strings to be freed with g_strfreev()
|
char * pango_trim_string (const char *str);
Trims leading and trailing whitespace from a string.
|
a string |
Returns : |
A newly-allocated string that must be freed with g_free()
|
gint pango_read_line (FILE *stream, GString *str);
Reads an entire line from a file into a buffer. Lines may be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter is not written into the buffer. Text after a '#' character is treated as a comment and skipped. '\' can be used to escape a # character. '\' proceeding a line delimiter combines adjacent lines. A '\' proceeding any other character is ignored and written into the output buffer unmodified.
|
a stdio stream |
|
GString buffer into which to write the result |
Returns : |
0 if the stream was already at an EOF character, otherwise
the number of lines read (this is useful for maintaining
a line number counter which doesn't combine lines with '\')
|
gboolean pango_skip_space (const char **pos);
Skips 0 or more characters of white space.
|
in/out string position |
Returns : |
FALSE if skipping the white space leaves
the position at a '\0' character.
|
gboolean pango_scan_word (const char **pos, GString *out);
Scans a word into a GString buffer. A word consists of [A-Za-z_] followed by zero or more [A-Za-z_0-9] Leading white space is skipped.
gboolean pango_scan_string (const char **pos, GString *out);
Scans a string into a GString buffer. The string may either be a sequence of non-white-space characters, or a quoted string with '"'. Instead a quoted string, '\"' represents a literal quote. Leading white space outside of quotes is skipped.
gboolean pango_scan_int (const char **pos, int *out);
Scans an integer. Leading white space is skipped.
|
in/out string position |
|
an int into which to write the result |
Returns : |
FALSE if a parse error occurred.
|
char * pango_config_key_get (const char *key);
Looks up a key in the Pango config database (pseudo-win.ini style, read from $sysconfdir/pango/pangorc, ~/.pangorc, and getenv (PANGO_RC_FILE).)
void pango_lookup_aliases (const char *fontname,
char ***families,
int *n_families);
Look up all user defined aliases for the alias fontname.
The resulting font family names will be stored in families,
and the number of families in n_families.
|
an ascii string |
|
will be set to an array of font family names. this array is owned by pango and should not be freed. |
|
will be set to the length of the families array.
|
gboolean pango_parse_enum (GType type, const char *str, int *value, gboolean warn, char **possible_values);
Parses an enum type and stores the result in value.
If str does not match the nick name of any of the possible values for the
enum and is not an integer, FALSE is returned, a warning is issued
if warn is TRUE, and a
string representing the list of possible values is stored in
possible_values. The list is slash-separated, eg.
"none/start/middle/end". If failed and possible_values is not NULL,
returned string should be freed using g_free().
|
enum type to parse, eg. PANGO_TYPE_ELLIPSIZE_MODE.
|
|
string to parse. May be NULL.
|
|
integer to store the result in, or NULL.
|
|
if TRUE, issue a g_warning() on bad input.
|
|
place to store list of possible values on failure, or NULL.
|
Returns : |
TRUE if str was successfully parsed.
|
Since 1.16
gboolean pango_parse_style (const char *str, PangoStyle *style, gboolean warn);
Parses a font style. The allowed values are "normal", "italic" and "oblique", case variations being ignored.
|
a string to parse. |
|
a PangoStyle to store the result in. |
|
if TRUE, issue a g_warning() on bad input.
|
Returns : |
TRUE if str was successfully parsed.
|
gboolean pango_parse_variant (const char *str, PangoVariant *variant, gboolean warn);
Parses a font variant. The allowed values are "normal" and "smallcaps" or "small_caps", case variations being ignored.
|
a string to parse. |
|
a PangoVariant to store the result in. |
|
if TRUE, issue a g_warning() on bad input.
|
Returns : |
TRUE if str was successfully parsed.
|
gboolean pango_parse_weight (const char *str, PangoWeight *weight, gboolean warn);
Parses a font weight. The allowed values are "heavy", "ultrabold", "bold", "normal", "light", "ultraleight" and integers. Case variations are ignored.
|
a string to parse. |
|
a PangoWeight to store the result in. |
|
if TRUE, issue a g_warning() on bad input.
|
Returns : |
TRUE if str was successfully parsed.
|
gboolean pango_parse_stretch (const char *str, PangoStretch *stretch, gboolean warn);
Parses a font stretch. The allowed values are "ultra_condensed", "extra_condensed", "condensed", "semi_condensed", "normal", "semi_expanded", "expanded", "extra_expanded" and "ultra_expanded". Case variations are ignored and the '_' characters may be omitted.
|
a string to parse. |
|
a PangoStretch to store the result in. |
|
if TRUE, issue a g_warning() on bad input.
|
Returns : |
TRUE if str was successfully parsed.
|
const char * pango_get_sysconf_subdirectory (void);
On Unix, returns the name of the "pango" subdirectory of SYSCONFDIR (which is set at compile time). On Windows, returns the etc\pango subdirectory of the Pango installation directory (which is deduced at run time from the DLL's location).
Returns : |
the Pango sysconf directory. The returned string should not be freed. |
const char * pango_get_lib_subdirectory (void);
On Unix, returns the name of the "pango" subdirectory of LIBDIR (which is set at compile time). On Windows, returns the lib\pango subdirectory of the Pango installation directory (which is deduced at run time from the DLL's location).
Returns : |
the Pango lib directory. The returned string should not be freed. |
guint8 * pango_log2vis_get_embedding_levels (const gchar *text, int length, PangoDirection *pbase_dir);
This will return the bidirectional embedding levels of the input paragraph as defined by the Unicode Bidirectional Algorithm available at:
http://www.unicode.org/reports/tr9/
If the input base direction is a weak direction, the direction of the characters in the text will determine the final resolved direction.
|
the text to itemize. |
|
the number of bytes (not characters) to process, or -1
if text is nul-terminated and the length should be calculated.
|
|
input base direction, and output resolved direction. |
Returns : |
a newly allocated array of embedding levels, one item per character (not byte), that should be freed using g_free. |
Since 1.4
gboolean pango_is_zero_width (gunichar ch);
Checks ch to see if it is a character that should not be
normally rendered on the screen. This includes all Unicode characters
with "ZERO WIDTH" in their name, as well as bidi formatting characters, and
a few other ones. This is totally different from g_unichar_iszerowidth()
and is at best misnamed.
Since 1.10
void pango_quantize_line_geometry (int *thickness,
int *position);
Quantizes the thickness and position of a line, typically an
underline or strikethrough, to whole device pixels, that is integer
multiples of PANGO_SCALE. The purpose of this function is to avoid
such lines looking blurry.
Care is taken to make sure thickness is at least one pixel when this
function returns, but returned position may become zero as a result
of rounding.
|
pointer to the thickness of a line, in Pango units |
|
corresponding position |
Since 1.12
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
enum PangoGravity; enum PangoGravityHint; #define PANGO_GRAVITY_IS_VERTICAL (gravity) PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix); PangoGravity pango_gravity_get_for_script (PangoScript script, PangoGravity base_gravity, PangoGravityHint hint); PangoGravity pango_gravity_get_for_script_and_width (PangoScript script, gboolean wide, PangoGravity base_gravity, PangoGravityHint hint); double pango_gravity_to_rotation (PangoGravity gravity);
Since 1.16, Pango is able to correctly lay vertical text out. In fact, it can set layouts of mixed vertical and non-vertical text. This section describes the types used for setting vertical text parameters.
The way this is implemented is through the concept of gravity. Gravity of normal Latin text is south. A gravity value of east means that glyphs will be rotated ninety degrees counterclockwise. So, to render vertical text one needs to set the gravity and rotate the layout using the matrix machinery already in place. This has the huge advantage that most algorithms working on a PangoLayout do not need any change as the assumption that lines run in the X direction and stack in the Y direction holds even for vertical text layouts.
Applications should only need to set base gravity on PangoContext in use, and
let Pango decide the gravity assigned to each run of text. This automatically
handles text with mixed scripts. A very common use is to set the context base
gravity to auto using pango_context_set_base_gravity()
and rotate the layout normally. Pango will make sure that
Asian languages take the right form, while other scripts are rotated normally.
The correct way to set gravity on a layout is to set it on the context
associated with it using pango_context_set_base_gravity(). The context
of a layout can be accessed using pango_layout_get_context(). The currently
set base gravity of the context can be accessed using
pango_context_get_base_gravity() and the resolved
gravity of it using pango_context_get_gravity(). The resolved gravity is
the same as the base gravity for the most part, except that if the base
gravity is set to PANGO_GRAVITY_AUTO, the resolved gravity will depend
on the current matrix set on context, and is derived using
pango_gravity_get_for_matrix().
The next thing an application may want to set on the context is the gravity hint. A PangoGravityHint instructs how different scripts should react to the set base gravity.
Font descriptions have a gravity property too, that can be set using
pango_font_description_set_gravity() and accessed using
pango_font_description_get_gravity(). However, those are rarely useful
from application code and are mainly used by PangoLayout internally.
Last but not least, one can create PangoAttributes for gravity
and gravity hint using pango_attr_gravity_new() and
pango_attr_gravity_hint_new().
typedef enum {
PANGO_GRAVITY_SOUTH,
PANGO_GRAVITY_EAST,
PANGO_GRAVITY_NORTH,
PANGO_GRAVITY_WEST,
PANGO_GRAVITY_AUTO
} PangoGravity;
The PangoGravity type represents the orientation of glyphs in a segment
of text. This is useful when rendering vertical text layouts. In
those situations, the layout is rotated using a non-identity PangoMatrix,
and then glyph orientation is controlled using PangoGravity.
Not every value in this enumeration makes sense for every usage of
PangoGravity; for example, PANGO_GRAVITY_AUTO only can be passed to
pango_context_set_base_gravity() and can only be returned by
pango_context_get_base_gravity().
See also: PangoGravityHint
| Glyphs stand upright (default) | |
| Glyphs are rotated 90 degrees clockwise | |
| Glyphs are upside-down | |
| Glyphs are rotated 90 degrees counter-clockwise | |
| Gravity is resolved from the context matrix |
Since 1.16
typedef enum {
PANGO_GRAVITY_HINT_NATURAL,
PANGO_GRAVITY_HINT_STRONG,
PANGO_GRAVITY_HINT_LINE
} PangoGravityHint;
The PangoGravityHint defines how horizontal scripts should behave in a vertical context. That is, English excerpt in a vertical paragraph for example.
See PangoGravity.
| scripts will take their natural gravity based on the base gravity and the script. This is the default. | |
| always use the base gravity set, regardless of the script. | |
| for scripts not in their natural direction (eg. Latin in East gravity), choose per-script gravity such that every script respects the line progression. This means, Latin and Arabic will take opposite gravities and both flow top-to-bottom for example. |
Since 1.16
#define PANGO_GRAVITY_IS_VERTICAL(gravity)
Whether a PangoGravity represents vertical writing directions.
|
the PangoGravity to check |
Since 1.16
PangoGravity pango_gravity_get_for_matrix (const PangoMatrix *matrix);
Finds the gravity that best matches the rotation component in a PangoMatrix.
|
a PangoMatrix |
Returns : |
the gravity of matrix, which will never be
PANGO_GRAVITY_AUTO, or PANGO_GRAVITY_SOUTH if matrix is NULL
|
Since 1.16
PangoGravity pango_gravity_get_for_script (PangoScript script, PangoGravity base_gravity, PangoGravityHint hint);
Based on the script, base gravity, and hint, returns actual gravity to use in laying out a single PangoItem.
If base_gravity is PANGO_GRAVITY_AUTO, it is first replaced with the
preferred gravity of script. To get the preferred gravity of a script,
pass PANGO_GRAVITY_AUTO and PANGO_GRAVITY_HINT_STRONG in.
|
PangoScript to query |
|
base gravity of the paragraph |
|
orientation hint |
Returns : |
resolved gravity suitable to use for a run of text
with script.
|
Since 1.16
PangoGravity pango_gravity_get_for_script_and_width (PangoScript script, gboolean wide, PangoGravity base_gravity, PangoGravityHint hint);
Based on the script, East Asian width, base gravity, and hint, returns actual gravity to use in laying out a single character or PangoItem.
This function is similar to pango_gravity_get_for_script() except
that this function makes a distinction between narrow/half-width and
wide/full-width characters also. Wide/full-width characters always
stand <emph>upright</emph>, that is, they always take the base gravity,
whereas narrow/full-width characters are always rotated in vertical
context.
If base_gravity is PANGO_GRAVITY_AUTO, it is first replaced with the
preferred gravity of script.
|
PangoScript to query |
|
TRUE for wide characters as returned by g_unichar_iswide()
|
|
base gravity of the paragraph |
|
orientation hint |
Returns : |
resolved gravity suitable to use for a run of text
with script and wide.
|
Since 1.26
double pango_gravity_to_rotation (PangoGravity gravity);
Converts a PangoGravity value to its natural rotation in radians.
gravity should not be PANGO_GRAVITY_AUTO.
Note that pango_matrix_rotate() takes angle in degrees, not radians.
So, to call pango_matrix_rotate() with the output of this function
you should multiply it by (180. / G_PI).
|
gravity to query |
Returns : |
the rotation value corresponding to gravity.
|
Since 1.16
pango_context_get_base_gravity(),
pango_context_set_base_gravity(),
pango_context_get_gravity(),
pango_context_get_gravity_hint(),
pango_context_set_gravity_hint(),
pango_font_description_set_gravity(),
pango_font_description_get_gravity(),
pango_attr_gravity_new(),
pango_attr_gravity_hint_new()
| Pango Reference Manual |
|---|
| Pango Reference Manual |
|---|
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
PangoIncludedModule;
PangoMap;
PangoMapEntry;
PangoMap * pango_find_map (PangoLanguage *language,
guint engine_type_id,
guint render_type_id);
PangoEngine * pango_map_get_engine (PangoMap *map,
PangoScript script);
void pango_map_get_engines (PangoMap *map,
PangoScript script,
GSList **exact_engines,
GSList **fallback_engines);
void pango_module_register (PangoIncludedModule *module);
Functions and macros in this section are used to support loading dynamic modules that add engines to Pango at run time.
typedef struct {
void (*list) (PangoEngineInfo **engines,
int *n_engines);
void (*init) (GTypeModule *module);
void (*exit) (void);
PangoEngine *(*create) (const char *id);
} PangoIncludedModule;
The PangoIncludedModule structure for a statically linked module contains the functions that would otherwise be loaded from a dynamically loaded module.
|
a function that lists the engines defined in this module. |
|
a function to initialize the module. |
|
a function to finalize the module. |
|
a function to create an engine, given the engine name. |
typedef struct _PangoMap PangoMap;
A PangoMap structure can be used to determine the engine to use for each character.
typedef struct _PangoMapEntry PangoMapEntry;
A PangoMapEntry contains information about the engine that should be used for the codepoint to which this entry belongs and also whether the engine matches the language tag for this entry's map exactly or just approximately.
PangoMap * pango_find_map (PangoLanguage *language, guint engine_type_id, guint render_type_id);
Locate a PangoMap for a particular engine type and render type. The resulting map can be used to determine the engine for each character.
|
the language tag for which to find the map |
|
the engine type for the map to find |
|
the render type for the map to find |
Returns : |
the suitable PangoMap. |
PangoEngine * pango_map_get_engine (PangoMap *map, PangoScript script);
Returns the best engine listed in the map for a given script
|
a PangoMap |
|
a PangoScript |
Returns : |
the best engine, if one is listed for the script,
or NULL. The lookup may cause the engine to be loaded;
once an engine is loaded, it won't be unloaded. If multiple
engines are exact for the script, the choice of which is
returned is arbitrary.
|
void pango_map_get_engines (PangoMap *map, PangoScript script, GSList **exact_engines, GSList **fallback_engines);
Finds engines in the map that handle the given script. The returned lists should be freed with g_slist_free, but the engines in the lists are owned by GLib and will be kept around permanently, so they should not be unref'ed.
|
a PangoMap |
|
a PangoScript |
|
location to store list of engines that exactly handle this script. |
|
location to store list of engines that approximately handle this script. |
Since 1.4
void pango_module_register (PangoIncludedModule *module);
Registers a statically linked module with Pango. The PangoIncludedModule structure that is passed in contains the functions that would otherwise be loaded from a dynamically loaded module.
|
a PangoIncludedModule |
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
Bidirectional TextBidirectional Text — Types and functions to help with handling bidirectional text |
enum PangoDirection; PangoDirection pango_unichar_direction (gunichar ch); PangoDirection pango_find_base_dir (const gchar *text, gint length); gboolean pango_get_mirror_char (gunichar ch, gunichar *mirrored_ch); enum PangoBidiType; PangoBidiType pango_bidi_type_for_unichar (gunichar ch);
Pango supports bidirectional text (like Arabic and Hebrew) automatically. Some applications however, need some help to correctly handle bidirectional text.
The PangoDirection type can be used with pango_context_set_base_dir() to
instruct Pango about direction of text, though in most cases Pango detects
that correctly and automatically. The rest of the facilities in this section
are used internally by Pango already, and are provided to help applications
that need more direct control over bidirectional setting of text.
typedef enum {
PANGO_DIRECTION_LTR,
PANGO_DIRECTION_RTL,
PANGO_DIRECTION_TTB_LTR,
PANGO_DIRECTION_TTB_RTL,
PANGO_DIRECTION_WEAK_LTR,
PANGO_DIRECTION_WEAK_RTL,
PANGO_DIRECTION_NEUTRAL
} PangoDirection;
The PangoDirection type represents a direction in the
Unicode bidirectional algorithm; not every value in this
enumeration makes sense for every usage of PangoDirection;
for example, the return value of pango_unichar_direction()
and pango_find_base_dir() cannot be PANGO_DIRECTION_WEAK_LTR
or PANGO_DIRECTION_WEAK_RTL, since every character is either
neutral or has a strong direction; on the other hand
PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
to pango_itemize_with_base_dir().
The PANGO_DIRECTION_TTB_LTR, PANGO_DIRECTION_TTB_RTL
values come from an earlier interpretation of this
enumeration as the writing direction of a block of
text and are no longer used; See PangoGravity for how
vertical text is handled in Pango.
| A strong left-to-right direction | |
| A strong right-to-left direction | |
Deprecated value; treated the
same as PANGO_DIRECTION_RTL.
|
|
Deprecated value; treated the
same as PANGO_DIRECTION_LTR
|
|
| A weak left-to-right direction | |
| A weak right-to-left direction | |
| No direction specified |
PangoDirection pango_unichar_direction (gunichar ch);
Determines the inherent direction of a character; either
PANGO_DIRECTION_LTR, PANGO_DIRECTION_RTL, or
PANGO_DIRECTION_NEUTRAL.
This function is useful to categorize characters into left-to-right
letters, right-to-left letters, and everything else. If full
Unicode bidirectional type of a character is needed,
pango_bidi_type_for_gunichar() can be used instead.
|
a Unicode character |
Returns : |
the direction of the character. |
PangoDirection pango_find_base_dir (const gchar *text, gint length);
Searches a string the first character that has a strong direction, according to the Unicode bidirectional algorithm.
|
the text to process |
|
length of text in bytes (may be -1 if text is nul-terminated)
|
Returns : |
The direction corresponding to the first strong character.
If no such character is found, then PANGO_DIRECTION_NEUTRAL is returned.
|
Since 1.4
gboolean pango_get_mirror_char (gunichar ch, gunichar *mirrored_ch);
pango_get_mirror_char is deprecated and should not be used in newly-written code.
If ch has the Unicode mirrored property and there is another Unicode
character that typically has a glyph that is the mirror image of ch's
glyph, puts that character in the address pointed to by mirrored_ch.
Use g_unichar_get_mirror_char() instead; the docs for that function
provide full details.
typedef enum {
/* Strong types */
PANGO_BIDI_TYPE_L,
PANGO_BIDI_TYPE_LRE,
PANGO_BIDI_TYPE_LRO,
PANGO_BIDI_TYPE_R,
PANGO_BIDI_TYPE_AL,
PANGO_BIDI_TYPE_RLE,
PANGO_BIDI_TYPE_RLO,
/* Weak types */
PANGO_BIDI_TYPE_PDF,
PANGO_BIDI_TYPE_EN,
PANGO_BIDI_TYPE_ES,
PANGO_BIDI_TYPE_ET,
PANGO_BIDI_TYPE_AN,
PANGO_BIDI_TYPE_CS,
PANGO_BIDI_TYPE_NSM,
PANGO_BIDI_TYPE_BN,
/* Neutral types */
PANGO_BIDI_TYPE_B,
PANGO_BIDI_TYPE_S,
PANGO_BIDI_TYPE_WS,
PANGO_BIDI_TYPE_ON
} PangoBidiType;
The PangoBidiType type represents the bidirectional character type of a Unicode character as specified by the Unicode bidirectional algorithm.
| Left-to-Right | |
| Left-to-Right Embedding | |
| Left-to-Right Override | |
| Right-to-Left | |
| Right-to-Left Arabic | |
| Right-to-Left Embedding | |
| Right-to-Left Override | |
| Pop Directional Format | |
| European Number | |
| European Number Separator | |
| European Number Terminator | |
| Arabic Number | |
| Common Number Separator | |
| Nonspacing Mark | |
| Boundary Neutral | |
| Paragraph Separator | |
| Segment Separator | |
| Whitespace | |
| Other Neutrals |
Since 1.22
PangoBidiType pango_bidi_type_for_unichar (gunichar ch);
Determines the normative bidirectional character type of a character, as specified in the Unicode Character Database.
A simplified version of this function is available as
pango_unichar_get_direction().
|
a Unicode character |
Returns : |
the bidirectional character type, as used in the Unicode bidirectional algorithm. |
Since 1.22
| Pango Reference Manual |
|---|
| Pango Reference Manual |
|---|
| Pango Reference Manual |
|---|
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
PangoRenderer;
enum PangoRenderPart;
#define PANGO_TYPE_RENDER_PART
PangoRendererClass;
void pango_renderer_draw_layout (PangoRenderer *renderer,
PangoLayout *layout,
int x,
int y);
void pango_renderer_draw_layout_line (PangoRenderer *renderer,
PangoLayoutLine *line,
int x,
int y);
void pango_renderer_draw_glyphs (PangoRenderer *renderer,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
void pango_renderer_draw_glyph_item (PangoRenderer *renderer,
const char *text,
PangoGlyphItem *glyph_item,
int x,
int y);
void pango_renderer_draw_rectangle (PangoRenderer *renderer,
PangoRenderPart part,
int x,
int y,
int width,
int height);
void pango_renderer_draw_error_underline (PangoRenderer *renderer,
int x,
int y,
int width,
int height);
void pango_renderer_draw_trapezoid (PangoRenderer *renderer,
PangoRenderPart part,
double y1_,
double x11,
double x21,
double y2,
double x12,
double x22);
void pango_renderer_draw_glyph (PangoRenderer *renderer,
PangoFont *font,
PangoGlyph glyph,
double x,
double y);
void pango_renderer_activate (PangoRenderer *renderer);
void pango_renderer_deactivate (PangoRenderer *renderer);
void pango_renderer_part_changed (PangoRenderer *renderer,
PangoRenderPart part);
void pango_renderer_set_color (PangoRenderer *renderer,
PangoRenderPart part,
const PangoColor *color);
PangoColor * pango_renderer_get_color (PangoRenderer *renderer,
PangoRenderPart part);
void pango_renderer_set_matrix (PangoRenderer *renderer,
const PangoMatrix *matrix);
const PangoMatrix * pango_renderer_get_matrix (PangoRenderer *renderer);
PangoLayout * pango_renderer_get_layout (PangoRenderer *renderer);
PangoLayoutLine * pango_renderer_get_layout_line (PangoRenderer *renderer);
PangoRenderer is a base class that contains the necessary logic for
rendering a PangoLayout or PangoLayoutLine. By subclassing
PangoRenderer and overriding operations such as draw_glyphs and
draw_rectangle, renderers for particular font backends and
destinations can be created.
typedef struct {
PangoMatrix *matrix; /* May be NULL */
} PangoRenderer;
PangoRenderer is a base class for objects that are used to render Pango objects such as PangoGlyphString and PangoLayout.
PangoMatrix * |
the current transformation matrix for the Renderer; may
be NULL, which should be treated the same as the identity matrix.
|
Since 1.8
typedef enum
{
PANGO_RENDER_PART_FOREGROUND,
PANGO_RENDER_PART_BACKGROUND,
PANGO_RENDER_PART_UNDERLINE,
PANGO_RENDER_PART_STRIKETHROUGH
} PangoRenderPart;
PangoRenderPart defines different items to render for such purposes as setting colors.
| the text itself | |
| the area behind the text | |
| underlines | |
| strikethrough lines |
Since 1.8
#define PANGO_TYPE_RENDER_PART (pango_render_part_get_type())
The GObject type for PangoRenderPart.
typedef struct {
/* All of the following have default implementations
* and take as coordinates user coordinates in Pango units
*/
void (*draw_glyphs) (PangoRenderer *renderer,
PangoFont *font,
PangoGlyphString *glyphs,
int x,
int y);
void (*draw_rectangle) (PangoRenderer *renderer,
PangoRenderPart part,
int x,
int y,
int width,
int height);
void (*draw_error_underline) (PangoRenderer *renderer,
int x,
int y,
int width,
int height);
/* Nothing is drawn for shaped glyphs unless this is implemented */
void (*draw_shape) (PangoRenderer *renderer,
PangoAttrShape *attr,
int x,
int y);
/* These two must be implemented and take coordinates in
* device space as doubles.
*/
void (*draw_trapezoid) (PangoRenderer *renderer,
PangoRenderPart part,
double y1_,
double x11,
double x21,
double y2,
double x12,
double x22);
void (*draw_glyph) (PangoRenderer *renderer,
PangoFont *font,
PangoGlyph glyph,
double x,
double y);
/* Notification of change in rendering attributes
*/
void (*part_changed) (PangoRenderer *renderer,
PangoRenderPart part);
/* Paired around drawing operations
*/
void (*begin) (PangoRenderer *renderer);
void (*end) (PangoRenderer *renderer);
/* Hooks into the details of layout rendering
*/
void (*prepare_run) (PangoRenderer *renderer,
PangoLayoutRun *run);
/* All of the following have default implementations
* and take as coordinates user coordinates in Pango units
*/
void (*draw_glyph_item) (PangoRenderer *renderer,
const char *text,
PangoGlyphItem *glyph_item,
int x,
int y);
} PangoRendererClass;
Class structure for PangoRenderer.
|
draws a PangoGlyphString |
|
draws a rectangle |
|
draws a squiggly line that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. |
|
draw content for a glyph shaped with PangoAttrShape.
x, y are the coordinates of the left edge of the baseline,
in user coordinates.
|
|
draws a trapezoidal filled area |
|
draws a single glyph |
|
do renderer specific processing when rendering attributes change |
|
Do renderer-specific initialization before drawing |
|
Do renderer-specific cleanup after drawing |
|
updates the renderer for a new run |
|
draws a PangoGlyphItem |
Since 1.8
void pango_renderer_draw_layout (PangoRenderer *renderer, PangoLayout *layout, int x, int y);
Draws layout with the specified PangoRenderer.
|
a PangoRenderer |
|
a PangoLayout |
|
X position of left edge of baseline, in user space coordinates in Pango units. |
|
Y position of left edge of baseline, in user space coordinates in Pango units. |
Since 1.8
void pango_renderer_draw_layout_line (PangoRenderer *renderer, PangoLayoutLine *line, int x, int y);
Draws line with the specified PangoRenderer.
|
a PangoRenderer |
|
a PangoLayoutLine |
|
X position of left edge of baseline, in user space coordinates in Pango units. |
|
Y position of left edge of baseline, in user space coordinates in Pango units. |
Since 1.8
void pango_renderer_draw_glyphs (PangoRenderer *renderer, PangoFont *font, PangoGlyphString *glyphs, int x, int y);
Draws the glyphs in glyphs with the specified PangoRenderer.
|
a PangoRenderer |
|
a PangoFont |
|
a PangoGlyphString |
|
X position of left edge of baseline, in user space coordinates in Pango units. |
|
Y position of left edge of baseline, in user space coordinates in Pango units. |
Since 1.8
void pango_renderer_draw_glyph_item (PangoRenderer *renderer, const char *text, PangoGlyphItem *glyph_item, int x, int y);
Draws the glyphs in glyph_item with the specified PangoRenderer,
embedding the text associated with the glyphs in the output if the
output format supports it (PDF for example).
Note that text is the start of the text for layout, which is then
indexed by .
glyph_item->item->offset
If text is NULL, this simply calls pango_renderer_draw_glyphs().
The default implementation of this method simply falls back to
pango_renderer_draw_glyphs().
|
a PangoRenderer |
|
the UTF-8 text that glyph_item refers to, or NULL
|
|
a PangoGlyphItem |
|
X position of left edge of baseline, in user space coordinates in Pango units. |
|
Y position of left edge of baseline, in user space coordinates in Pango units. |
Since 1.22
void pango_renderer_draw_rectangle (PangoRenderer *renderer, PangoRenderPart part, int x, int y, int width, int height);
Draws an axis-aligned rectangle in user space coordinates with the specified PangoRenderer.
This should be called while renderer is already active. Use
pango_renderer_activate() to activate a renderer.
|
a PangoRenderer |
|
type of object this rectangle is part of |
|
X position at which to draw rectangle, in user space coordinates in Pango units |
|
Y position at which to draw rectangle, in user space coordinates in Pango units |
|
width of rectangle in Pango units in user space coordinates |
|
height of rectangle in Pango units in user space coordinates |
Since 1.8
void pango_renderer_draw_error_underline (PangoRenderer *renderer, int x, int y, int width, int height);
Draw a squiggly line that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle)
This should be called while renderer is already active. Use
pango_renderer_activate() to activate a renderer.
|
a PangoRenderer |
|
X coordinate of underline, in Pango units in user coordinate system |
|
Y coordinate of underline, in Pango units in user coordinate system |
|
width of underline, in Pango units in user coordinate system |
|
height of underline, in Pango units in user coordinate system |
Since 1.8
void pango_renderer_draw_trapezoid (PangoRenderer *renderer, PangoRenderPart part, double y1_, double x11, double x21, double y2, double x12, double x22);
Draws a trapezoid with the parallel sides aligned with the X axis using the given PangoRenderer; coordinates are in device space.
|
a PangoRenderer |
|
type of object this trapezoid is part of |
|
Y coordinate of top of trapezoid |
|
X coordinate of left end of top of trapezoid |
|
X coordinate of right end of top of trapezoid |
|
Y coordinate of bottom of trapezoid |
|
X coordinate of left end of bottom of trapezoid |
|
X coordinate of right end of bottom of trapezoid |
Since 1.8
void pango_renderer_draw_glyph (PangoRenderer *renderer, PangoFont *font, PangoGlyph glyph, double x, double y);
Draws a single glyph with coordinates in device space.
|
a PangoRenderer |
|
a PangoFont |
|
the glyph index of a single glyph |
|
X coordinate of left edge of baseline of glyph |
|
Y coordinate of left edge of baseline of glyph |
Since 1.8
void pango_renderer_activate (PangoRenderer *renderer);
Does initial setup before rendering operations on renderer.
pango_renderer_deactivate() should be called when done drawing.
Calls such as pango_renderer_draw_layout() automatically
activate the layout before drawing on it. Calls to
pango_renderer_activate() and pango_renderer_deactivate() can
be nested and the renderer will only be initialized and
deinitialized once.
|
a PangoRenderer |
Since 1.8
void pango_renderer_deactivate (PangoRenderer *renderer);
Cleans up after rendering operations on renderer. See
docs for pango_renderer_activate().
|
a PangoRenderer |
Since 1.8
void pango_renderer_part_changed (PangoRenderer *renderer, PangoRenderPart part);
Informs Pango that the way that the rendering is done
for part has changed in a way that would prevent multiple
pieces being joined together into one drawing call. For
instance, if a subclass of PangoRenderer was to add a stipple
option for drawing underlines, it needs to call
pango_renderer_part_changed (render, PANGO_RENDER_PART_UNDERLINE);
When the stipple changes or underlines with different stipples
might be joined together. Pango automatically calls this for
changes to colors. (See pango_renderer_set_color())
|
a PangoRenderer |
|
the part for which rendering has changed. |
Since 1.8
void pango_renderer_set_color (PangoRenderer *renderer, PangoRenderPart part, const PangoColor *color);
Sets the color for part of the rendering.
|
a PangoRenderer |
|
the part to change the color of |
|
the new color or NULL to unset the current color
|
Since 1.8
PangoColor * pango_renderer_get_color (PangoRenderer *renderer, PangoRenderPart part);
Gets the current rendering color for the specified part.
|
a PangoRenderer |
|
the part to get the color for |
Returns : |
the color for the specified part, or NULL
if it hasn't been set and should be inherited from the
environment.
|
Since 1.8
void pango_renderer_set_matrix (PangoRenderer *renderer, const PangoMatrix *matrix);
Sets the transformation matrix that will be applied when rendering.
|
a PangoRenderer |
|
a PangoMatrix, or NULL to unset any existing matrix.
(No matrix set is the same as setting the identity matrix.)
|
Since 1.8
const PangoMatrix * pango_renderer_get_matrix (PangoRenderer *renderer);
Gets the transformation matrix that will be applied when
rendering. See pango_renderer_set_matrix().
|
a PangoRenderer |
Returns : |
the matrix, or NULL if no matrix has been set
(which is the same as the identity matrix). The returned
matrix is owned by Pango and must not be modified or
freed.
|
Since 1.8
PangoLayout * pango_renderer_get_layout (PangoRenderer *renderer);
Gets the layout currently being rendered using renderer.
Calling this function only makes sense from inside a subclass's
methods, like in its draw_shape() for example.
The returned layout should not be modified while still being rendered.
|
a PangoRenderer |
Returns : |
the layout, or NULL if no layout is being
rendered using renderer at this time.
|
Since 1.20
PangoLayoutLine * pango_renderer_get_layout_line (PangoRenderer *renderer);
Gets the layout line currently being rendered using renderer.
Calling this function only makes sense from inside a subclass's
methods, like in its draw_shape() for example.
The returned layout line should not be modified while still being rendered.
|
a PangoRenderer |
Returns : |
the layout line, or NULL if no layout line is being
rendered using renderer at this time.
|
Since 1.20
| Pango Reference Manual |
|---|
| Pango Reference Manual |
|---|
GObject
PangoFontMap
PangoFcFontMap
PangoFT2FontMap
PangoXftFontMap
PangoFont
PangoFcFont
PangoXftFont
PangoContext
PangoEngine
PangoEngineLang
PangoEngineShape
PangoFcDecoder
PangoFontFace
PangoFontFamily
PangoFontset
PangoFontsetSimple
PangoLayout
PangoOTInfo
PangoOTRuleset
PangoRenderer
PangoXftRenderer
GInterface
PangoCairoFontMap
PangoCairoFont
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
PangoLayout;
PangoLayoutIter;
PangoLayout * pango_layout_new (PangoContext *context);
PangoLayout * pango_layout_copy (PangoLayout *src);
PangoContext * pango_layout_get_context (PangoLayout *layout);
void pango_layout_context_changed (PangoLayout *layout);
void pango_layout_set_text (PangoLayout *layout,
const char *text,
int length);
const char * pango_layout_get_text (PangoLayout *layout);
void pango_layout_set_markup (PangoLayout *layout,
const char *markup,
int length);
void pango_layout_set_markup_with_accel (PangoLayout *layout,
const char *markup,
int length,
gunichar accel_marker,
gunichar *accel_char);
void pango_layout_set_attributes (PangoLayout *layout,
PangoAttrList *attrs);
PangoAttrList * pango_layout_get_attributes (PangoLayout *layout);
void pango_layout_set_font_description (PangoLayout *layout,
const PangoFontDescription *desc);
const PangoFontDescription * pango_layout_get_font_description
(PangoLayout *layout);
void pango_layout_set_width (PangoLayout *layout,
int width);
int pango_layout_get_width (PangoLayout *layout);
void pango_layout_set_height (PangoLayout *layout,
int height);
int pango_layout_get_height (PangoLayout *layout);
void pango_layout_set_wrap (PangoLayout *layout,
PangoWrapMode wrap);
PangoWrapMode pango_layout_get_wrap (PangoLayout *layout);
gboolean pango_layout_is_wrapped (PangoLayout *layout);
enum PangoWrapMode;
#define PANGO_TYPE_WRAP_MODE
void pango_layout_set_ellipsize (PangoLayout *layout,
PangoEllipsizeMode ellipsize);
PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout);
gboolean pango_layout_is_ellipsized (PangoLayout *layout);
enum PangoEllipsizeMode;
#define PANGO_TYPE_ELLIPSIZE_MODE
void pango_layout_set_indent (PangoLayout *layout,
int indent);
int pango_layout_get_indent (PangoLayout *layout);
int pango_layout_get_spacing (PangoLayout *layout);
void pango_layout_set_spacing (PangoLayout *layout,
int spacing);
void pango_layout_set_justify (PangoLayout *layout,
gboolean justify);
gboolean pango_layout_get_justify (PangoLayout *layout);
void pango_layout_set_auto_dir (PangoLayout *layout,
gboolean auto_dir);
gboolean pango_layout_get_auto_dir (PangoLayout *layout);
void pango_layout_set_alignment (PangoLayout *layout,
PangoAlignment alignment);
PangoAlignment pango_layout_get_alignment (PangoLayout *layout);
void pango_layout_set_tabs (PangoLayout *layout,
PangoTabArray *tabs);
PangoTabArray* pango_layout_get_tabs (PangoLayout *layout);
void pango_layout_set_single_paragraph_mode
(PangoLayout *layout,
gboolean setting);
gboolean pango_layout_get_single_paragraph_mode
(PangoLayout *layout);
enum PangoAlignment;
#define PANGO_TYPE_ALIGNMENT
int pango_layout_get_unknown_glyphs_count
(PangoLayout *layout);
void pango_layout_get_log_attrs (PangoLayout *layout,
PangoLogAttr **attrs,
gint *n_attrs);
void pango_layout_index_to_pos (PangoLayout *layout,
int index_,
PangoRectangle *pos);
void pango_layout_index_to_line_x (PangoLayout *layout,
int index_,
gboolean trailing,
int *line,
int *x_pos);
gboolean pango_layout_xy_to_index (PangoLayout *layout,
int x,
int y,
int *index_,
int *trailing);
void pango_layout_get_cursor_pos (PangoLayout *layout,
int index_,
PangoRectangle *strong_pos,
PangoRectangle *weak_pos);
void pango_layout_move_cursor_visually (PangoLayout *layout,
gboolean strong,
int old_index,
int old_trailing,
int direction,
int *new_index,
int *new_trailing);
void pango_layout_get_extents (PangoLayout *layout,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_get_pixel_extents (PangoLayout *layout,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_get_size (PangoLayout *layout,
int *width,
int *height);
void pango_layout_get_pixel_size (PangoLayout *layout,
int *width,
int *height);
int pango_layout_get_baseline (PangoLayout *layout);
int pango_layout_get_line_count (PangoLayout *layout);
PangoLayoutLine * pango_layout_get_line (PangoLayout *layout,
int line);
PangoLayoutLine * pango_layout_get_line_readonly (PangoLayout *layout,
int line);
GSList * pango_layout_get_lines (PangoLayout *layout);
GSList * pango_layout_get_lines_readonly (PangoLayout *layout);
PangoLayoutIter * pango_layout_get_iter (PangoLayout *layout);
PangoLayoutIter * pango_layout_iter_copy (PangoLayoutIter *iter);
void pango_layout_iter_free (PangoLayoutIter *iter);
gboolean pango_layout_iter_next_run (PangoLayoutIter *iter);
gboolean pango_layout_iter_next_char (PangoLayoutIter *iter);
gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter);
gboolean pango_layout_iter_next_line (PangoLayoutIter *iter);
gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter);
int pango_layout_iter_get_index (PangoLayoutIter *iter);
int pango_layout_iter_get_baseline (PangoLayoutIter *iter);
PangoLayoutRun * pango_layout_iter_get_run (PangoLayoutIter *iter);
PangoLayoutRun * pango_layout_iter_get_run_readonly (PangoLayoutIter *iter);
PangoLayoutLine * pango_layout_iter_get_line (PangoLayoutIter *iter);
PangoLayoutLine * pango_layout_iter_get_line_readonly (PangoLayoutIter *iter);
PangoLayout * pango_layout_iter_get_layout (PangoLayoutIter *iter);
void pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
PangoRectangle *logical_rect);
void pango_layout_iter_get_cluster_extents
(PangoLayoutIter *iter,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_iter_get_run_extents (PangoLayoutIter *iter,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter,
int *y0_,
int *y1_);
void pango_layout_iter_get_line_extents (PangoLayoutIter *iter,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_iter_get_layout_extents
(PangoLayoutIter *iter,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
PangoLayoutLine;
typedef PangoLayoutRun;
PangoLayoutLine * pango_layout_line_ref (PangoLayoutLine *line);
void pango_layout_line_unref (PangoLayoutLine *line);
void pango_layout_line_get_extents (PangoLayoutLine *line,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
void pango_layout_line_index_to_x (PangoLayoutLine *line,
int index_,
gboolean trailing,
int *x_pos);
gboolean pango_layout_line_x_to_index (PangoLayoutLine *line,
int x_pos,
int *index_,
int *trailing);
void pango_layout_line_get_x_ranges (PangoLayoutLine *line,
int start_index,
int end_index,
int **ranges,
int *n_ranges);
While complete access to the layout capabilities of Pango is provided using the detailed interfaces for itemization and shaping, using that functionality directly involves writing a fairly large amount of code. The objects and functions in this section provide a high-level driver for formatting entire paragraphs of text at once.
typedef struct _PangoLayout PangoLayout;
The PangoLayout structure represents an entire paragraph of text. It is initialized with a PangoContext, UTF-8 string and set of attributes for that string. Once that is done, the set of formatted lines can be extracted from the object, the layout can be rendered, and conversion between logical character positions within the layout's text, and the physical position of the resulting glyphs can be made.
There are also a number of parameters to adjust the formatting of a PangoLayout, which are illustrated in Figure 1, “Adjustable parameters for a PangoLayout”. It is possible, as well, to ignore the 2-D setup, and simply treat the results of a PangoLayout as a list of lines.
The PangoLayout structure is opaque, and has no user-visible fields.
typedef struct _PangoLayoutIter PangoLayoutIter;
A PangoLayoutIter structure can be used to iterate over the visual extents of a PangoLayout.
The PangoLayoutIter structure is opaque, and has no user-visible fields.
PangoLayout * pango_layout_new (PangoContext *context);
Create a new PangoLayout object with attributes initialized to default values for a particular PangoContext.
|
a PangoContext |
Returns : |
the newly allocated PangoLayout, with a reference
count of one, which should be freed with
g_object_unref().
|
PangoLayout * pango_layout_copy (PangoLayout *src);
Does a deep copy-by-value of the src layout. The attribute list,
tab array, and text from the original layout are all copied by
value.
|
a PangoLayout |
Returns : |
the newly allocated PangoLayout, with a reference
count of one, which should be freed with
g_object_unref().
|
PangoContext * pango_layout_get_context (PangoLayout *layout);
Retrieves the PangoContext used for this layout.
|
a PangoLayout |
Returns : |
the PangoContext for the layout. This does not have an additional refcount added, so if you want to keep a copy of this around, you must reference it yourself. |
void pango_layout_context_changed (PangoLayout *layout);
Forces recomputation of any state in the PangoLayout that might depend on the layout's context. This function should be called if you make changes to the context subsequent to creating the layout.
|
a PangoLayout |
void pango_layout_set_text (PangoLayout *layout, const char *text, int length);
Sets the text of the layout.
Note that if you have used
pango_layout_set_markup() or pango_layout_set_markup_with_accel() on
layout before, you may want to call pango_layout_set_attributes() to clear
the attributes set on the layout from the markup as this function does not
clear attributes.
|
a PangoLayout |
|
a valid UTF-8 string |
|
maximum length of text, in bytes. -1 indicates that
the string is nul-terminated and the length should be
calculated. The text will also be truncated on
encountering a nul-termination even when length is
positive.
|
const char * pango_layout_get_text (PangoLayout *layout);
Gets the text in the layout. The returned text should not be freed or modified.
|
a PangoLayout |
Returns : |
the text in the layout.
|
void pango_layout_set_markup (PangoLayout *layout, const char *markup, int length);
Same as pango_layout_set_markup_with_accel(), but
the markup text isn't scanned for accelerators.
|
a PangoLayout |
|
marked-up text |
|
length of marked-up text in bytes, or -1 if markup is
nul-terminated
|
void pango_layout_set_markup_with_accel (PangoLayout *layout, const char *markup, int length, gunichar accel_marker, gunichar *accel_char);
Sets the layout text and attribute list from marked-up text (see markup format). Replaces the current text and attribute list.
If accel_marker is nonzero, the given character will mark the
character following it as an accelerator. For example, accel_marker
might be an ampersand or underscore. All characters marked
as an accelerator will receive a PANGO_UNDERLINE_LOW attribute,
and the first character so marked will be returned in accel_char.
Two accel_marker characters following each other produce a single
literal accel_marker character.
|
a PangoLayout |
|
marked-up text (see markup format) |
|
length of marked-up text in bytes, or -1 if markup is
nul-terminated
|
|
marker for accelerators in the text |
|
return location for first located accelerator, or NULL
|
void pango_layout_set_attributes (PangoLayout *layout, PangoAttrList *attrs);
Sets the text attributes for a layout object.
References attrs, so the caller can unref its reference.
|
a PangoLayout |
|
a PangoAttrList, can be NULL
|
PangoAttrList * pango_layout_get_attributes (PangoLayout *layout);
Gets the attribute list for the layout, if any.
|
a PangoLayout |
Returns : |
a PangoAttrList. |
void pango_layout_set_font_description (PangoLayout *layout, const PangoFontDescription *desc);
Sets the default font description for the layout. If no font description is set on the layout, the font description from the layout's context is used.
|
a PangoLayout |
|
the new PangoFontDescription, or NULL to unset the
current font description
|
const PangoFontDescription * pango_layout_get_font_description (PangoLayout *layout);
Gets the font description for the layout, if any.
|
a PangoLayout |
Returns : |
a pointer to the layout's font description,
or NULL if the font description from the layout's
context is inherited. This value is owned by the layout
and must not be modified or freed.
|
Since 1.8
void pango_layout_set_width (PangoLayout *layout, int width);
Sets the width to which the lines of the PangoLayout should wrap or ellipsized. The default value is -1: no width set.
|
a PangoLayout. |
|
the desired width in Pango units, or -1 to indicate that no wrapping or ellipsization should be performed. |
int pango_layout_get_width (PangoLayout *layout);
Gets the width to which the lines of the PangoLayout should wrap.
|
a PangoLayout |
Returns : |
the width in Pango units, or -1 if no width set. |
void pango_layout_set_height (PangoLayout *layout, int height);
Sets the height to which the PangoLayout should be ellipsized at. There
are two different behaviors, based on whether height is positive or
negative.
If height is positive, it will be the maximum height of the layout. Only
lines would be shown that would fit, and if there is any text omitted,
an ellipsis added. At least one line is included in each paragraph regardless
of how small the height value is. A value of zero will render exactly one
line for the entire layout.
If height is negative, it will be the (negative of) maximum number of lines per
paragraph. That is, the total number of lines shown may well be more than
this value if the layout contains multiple paragraphs of text.
The default value of -1 means that first line of each paragraph is ellipsized.
This behvaior may be changed in the future to act per layout instead of per
paragraph. File a bug against pango at http://bugzilla.gnome.org/ if your
code relies on this behavior.
Height setting only has effect if a positive width is set on
layout and ellipsization mode of layout is not PANGO_ELLIPSIZE_NONE.
The behavior is undefined if a height other than -1 is set and
ellipsization mode is set to PANGO_ELLIPSIZE_NONE, and may change in the
future.
|
a PangoLayout. |
|
the desired height of the layout in Pango units if positive, or desired number of lines if negative. |
Since 1.20
int pango_layout_get_height (PangoLayout *layout);
Gets the height of layout used for ellipsization. See
pango_layout_set_height() for details.
|
a PangoLayout |
Returns : |
the height, in Pango units if positive, or number of lines if negative. |
Since 1.20
void pango_layout_set_wrap (PangoLayout *layout, PangoWrapMode wrap);
Sets the wrap mode; the wrap mode only has effect if a width
is set on the layout with pango_layout_set_width().
To turn off wrapping, set the width to -1.
|
a PangoLayout |
|
the wrap mode |
PangoWrapMode pango_layout_get_wrap (PangoLayout *layout);
Gets the wrap mode for the layout.
Use pango_layout_is_wrapped() to query whether any paragraphs
were actually wrapped.
|
a PangoLayout |
Returns : |
active wrap mode. |
gboolean pango_layout_is_wrapped (PangoLayout *layout);
Queries whether the layout had to wrap any paragraphs.
This returns TRUE if a positive width is set on layout,
ellipsization mode of layout is set to PANGO_ELLIPSIZE_NONE,
and there are paragraphs exceeding the layout width that have
to be wrapped.
|
a PangoLayout |
Returns : |
TRUE if any paragraphs had to be wrapped, FALSE
otherwise.
|
Since 1.16
typedef enum {
PANGO_WRAP_WORD,
PANGO_WRAP_CHAR,
PANGO_WRAP_WORD_CHAR
} PangoWrapMode;
A PangoWrapMode describes how to wrap the lines of a PangoLayout to the desired width.
#define PANGO_TYPE_WRAP_MODE (pango_wrap_mode_get_type())
The GObject type for PangoWrapMode.
void pango_layout_set_ellipsize (PangoLayout *layout, PangoEllipsizeMode ellipsize);
Sets the type of ellipsization being performed for layout.
Depending on the ellipsization mode ellipsize text is
removed from the start, middle, or end of text so they
fit within the width and height of layout set with
pango_layout_set_width() and pango_layout_set_height().
If the layout contains characters such as newlines that
force it to be layed out in multiple paragraphs, then whether
each paragraph is ellipsized separately or the entire layout
is ellipsized as a whole depends on the set height of the layout.
See pango_layout_set_height() for details.
|
a PangoLayout |
|
the new ellipsization mode for layout
|
Since 1.6
PangoEllipsizeMode pango_layout_get_ellipsize (PangoLayout *layout);
Gets the type of ellipsization being performed for layout.
See pango_layout_set_ellipsize()
|
a PangoLayout |
Returns : |
the current ellipsization mode for layout.
Use pango_layout_is_ellipsized() to query whether any paragraphs
were actually ellipsized.
|
Since 1.6
gboolean pango_layout_is_ellipsized (PangoLayout *layout);
Queries whether the layout had to ellipsize any paragraphs.
This returns TRUE if the ellipsization mode for layout
is not PANGO_ELLIPSIZE_NONE, a positive width is set on layout,
and there are paragraphs exceeding that width that have to be
ellipsized.
|
a PangoLayout |
Returns : |
TRUE if any paragraphs had to be ellipsized, FALSE
otherwise.
|
Since 1.16
typedef enum {
PANGO_ELLIPSIZE_NONE,
PANGO_ELLIPSIZE_START,
PANGO_ELLIPSIZE_MIDDLE,
PANGO_ELLIPSIZE_END
} PangoEllipsizeMode;
The PangoEllipsizeMode type describes what sort of (if any) ellipsization should be applied to a line of text. In the ellipsization process characters are removed from the text in order to make it fit to a given width and replaced with an ellipsis.
#define PANGO_TYPE_ELLIPSIZE_MODE (pango_ellipsize_mode_get_type())
The GObject type for PangoEllipsizeMode.
void pango_layout_set_indent (PangoLayout *layout, int indent);
Sets the width in Pango units to indent each paragraph. A negative value
of indent will produce a hanging indentation. That is, the first line will
have the full width, and subsequent lines will be indented by the
absolute value of indent.
The indent setting is ignored if layout alignment is set to
PANGO_ALIGN_CENTER.
|
a PangoLayout. |
|
the amount by which to indent. |
int pango_layout_get_indent (PangoLayout *layout);
Gets the paragraph indent width in Pango units. A negative value indicates a hanging indentation.
|
a PangoLayout |
Returns : |
the indent in Pango units. |
int pango_layout_get_spacing (PangoLayout *layout);
Gets the amount of spacing between the lines of the layout.
|
a PangoLayout |
Returns : |
the spacing in Pango units. |
void pango_layout_set_spacing (PangoLayout *layout, int spacing);
Sets the amount of spacing in Pango unit between the lines of the layout.
|
a PangoLayout. |
|
the amount of spacing |
void pango_layout_set_justify (PangoLayout *layout, gboolean justify);
Sets whether each complete line should be stretched to fill the entire width of the layout. This stretching is typically done by adding whitespace, but for some scripts (such as Arabic), the justification may be done in more complex ways, like extending the characters.
Note that this setting is not implemented and so is ignored in Pango older than 1.18.
|
a PangoLayout |
|
whether the lines in the layout should be justified. |
gboolean pango_layout_get_justify (PangoLayout *layout);
Gets whether each complete line should be stretched to fill the entire width of the layout.
|
a PangoLayout |
Returns : |
the justify. |
void pango_layout_set_auto_dir (PangoLayout *layout, gboolean auto_dir);
Sets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout;
when this flag is on (the default), then paragraphs in
layout that begin with strong right-to-left characters
(Arabic and Hebrew principally), will have right-to-left
layout, paragraphs with letters from other scripts will
have left-to-right layout. Paragraphs with only neutral
characters get their direction from the surrounding paragraphs.
When FALSE, the choice between left-to-right and
right-to-left layout is done according to the base direction
of the layout's PangoContext. (See pango_context_set_base_dir()).
When the auto-computed direction of a paragraph differs from the
base direction of the context, the interpretation of
PANGO_ALIGN_LEFT and PANGO_ALIGN_RIGHT are swapped.
|
a PangoLayout |
|
if TRUE, compute the bidirectional base direction
from the layout's contents.
|
Since 1.4
gboolean pango_layout_get_auto_dir (PangoLayout *layout);
Gets whether to calculate the bidirectional base direction
for the layout according to the contents of the layout.
See pango_layout_set_auto_dir().
|
a PangoLayout |
Returns : |
TRUE if the bidirectional base direction
is computed from the layout's contents, FALSE otherwise.
|
Since 1.4
void pango_layout_set_alignment (PangoLayout *layout, PangoAlignment alignment);
Sets the alignment for the layout: how partial lines are positioned within the horizontal space available.
|
a PangoLayout |
|
the alignment |
PangoAlignment pango_layout_get_alignment (PangoLayout *layout);
Gets the alignment for the layout: how partial lines are positioned within the horizontal space available.
|
a PangoLayout |
Returns : |
the alignment. |
void pango_layout_set_tabs (PangoLayout *layout, PangoTabArray *tabs);
Sets the tabs to use for layout, overriding the default tabs
(by default, tabs are every 8 spaces). If tabs is NULL, the default
tabs are reinstated. tabs is copied into the layout; you must
free your copy of tabs yourself.
|
a PangoLayout |
|
a PangoTabArray, or NULL
|
PangoTabArray* pango_layout_get_tabs (PangoLayout *layout);
Gets the current PangoTabArray used by this layout. If no
PangoTabArray has been set, then the default tabs are in use
and NULL is returned. Default tabs are every 8 spaces.
The return value should be freed with pango_tab_array_free().
|
a PangoLayout |
Returns : |
a copy of the tabs for this layout, or NULL.
|
void pango_layout_set_single_paragraph_mode
(PangoLayout *layout,
gboolean setting);
If setting is TRUE, do not treat newlines and similar characters
as paragraph separators; instead, keep all text in a single paragraph,
and display a glyph for paragraph separator characters. Used when
you want to allow editing of newlines on a single text line.
|
a PangoLayout |
|
new setting |
gboolean pango_layout_get_single_paragraph_mode (PangoLayout *layout);
Obtains the value set by pango_layout_set_single_paragraph_mode().
|
a PangoLayout |
Returns : |
TRUE if the layout does not break paragraphs at
paragraph separator characters, FALSE otherwise.
|
typedef enum {
PANGO_ALIGN_LEFT,
PANGO_ALIGN_CENTER,
PANGO_ALIGN_RIGHT
} PangoAlignment;
A PangoAlignment describes how to align the lines of a PangoLayout within the
available space. If the PangoLayout is set to justify
using pango_layout_set_justify(), this only has effect for partial lines.
#define PANGO_TYPE_ALIGNMENT (pango_alignment_get_type())
The GObject type for PangoAlignment.
int pango_layout_get_unknown_glyphs_count
(PangoLayout *layout);
Counts the number unknown glyphs in layout. That is, zero if
glyphs for all characters in the layout text were found, or more
than zero otherwise.
This function can be used to determine if there are any fonts
available to render all characters in a certain string, or when
used in combination with PANGO_ATTR_FALLBACK, to check if a
certain font supports all the characters in the string.
|
a PangoLayout |
Returns : |
The number of unknown glyphs in layout.
|
Since 1.16
void pango_layout_get_log_attrs (PangoLayout *layout, PangoLogAttr **attrs, gint *n_attrs);
Retrieves an array of logical attributes for each character in
the layout.
|
a PangoLayout |
|
location to store a pointer to an array of logical attributes
This value must be freed with g_free().
|
|
location to store the number of the attributes in the array. (The stored value will be one more than the total number of characters in the layout, since there need to be attributes corresponding to both the position before the first character and the position after the last character.) |
void pango_layout_index_to_pos (PangoLayout *layout, int index_, PangoRectangle *pos);
Converts from an index within a PangoLayout to the onscreen position
corresponding to the grapheme at that index, which is represented
as rectangle. Note that pos->x is always the leading
edge of the grapheme and pos->x + pos->width the trailing
edge of the grapheme. If the directionality of the grapheme is right-to-left,
then pos->width will be negative.
|
a PangoLayout |
|
byte index within layout
|
|
rectangle in which to store the position of the grapheme |
void pango_layout_index_to_line_x (PangoLayout *layout, int index_, gboolean trailing, int *line, int *x_pos);
Converts from byte index_ within the layout to line and X position.
(X position is measured from the left edge of the line)
|
a PangoLayout |
|
the byte index of a grapheme within the layout. |
|
an integer indicating the edge of the grapheme to retrieve the position of. If 0, the trailing edge of the grapheme, if > 0, the leading of the grapheme. |
|
location to store resulting line index. (which will between 0 and pango_layout_get_line_count(layout) - 1) |
|
location to store resulting position within line
(PANGO_SCALE units per device unit)
|
gboolean pango_layout_xy_to_index (PangoLayout *layout, int x, int y, int *index_, int *trailing);
Converts from X and Y position within a layout to the byte
index to the character at that logical position. If the
Y position is not inside the layout, the closest position is chosen
(the position will be clamped inside the layout). If the
X position is not within the layout, then the start or the
end of the line is chosen as described for pango_layout_x_to_index().
If either the X or Y positions were not inside the layout, then the
function returns FALSE; on an exact hit, it returns TRUE.
|
a PangoLayout |
|
the X offset (in Pango units) from the left edge of the layout. |
|
the Y offset (in Pango units) from the top edge of the layout |
|
location to store calculated byte index |
|
location to store a integer indicating where in the grapheme the user clicked. It will either be zero, or the number of characters in the grapheme. 0 represents the trailing edge of the grapheme. |
Returns : |
TRUE if the coordinates were inside text, FALSE otherwise.
|
void pango_layout_get_cursor_pos (PangoLayout *layout, int index_, PangoRectangle *strong_pos, PangoRectangle *weak_pos);
Given an index within a layout, determines the positions that of the strong and weak cursors if the insertion point is at that index. The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction of the layout are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the layout are inserted.
|
a PangoLayout |
|
the byte index of the cursor |
|
location to store the strong cursor position (may be NULL)
|
|
location to store the weak cursor position (may be NULL)
|
void pango_layout_move_cursor_visually (PangoLayout *layout, gboolean strong, int old_index, int old_trailing, int direction, int *new_index, int *new_trailing);
Computes a new cursor position from an old position and
a count of positions to move visually. If direction is positive,
then the new strong cursor position will be one position
to the right of the old cursor position. If direction is negative,
then the new strong cursor position will be one position
to the left of the old cursor position.
In the presence of bidirectional text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run.
Motion here is in cursor positions, not in characters, so a
single call to pango_layout_move_cursor_visually() may move the
cursor over multiple characters when multiple characters combine
to form a single grapheme.
|
a PangoLayout. |
|
whether the moving cursor is the strong cursor or the weak cursor. The strong cursor is the cursor corresponding to text insertion in the base direction for the layout. |
|
the byte index of the grapheme for the old index |
|
if 0, the cursor was at the trailing edge of the
grapheme indicated by old_index, if > 0, the cursor
was at the leading edge.
|
|
direction to move cursor. A negative value indicates motion to the left. |
|
location to store the new cursor byte index. A value of -1
indicates that the cursor has been moved off the beginning
of the layout. A value of G_MAXINT indicates that
the cursor has been moved off the end of the layout.
|
|
number of characters to move forward from the location returned
for new_index to get the position where the cursor should
be displayed. This allows distinguishing the position at
the beginning of one line from the position at the end
of the preceding line. new_index is always on the line
where the cursor should be displayed.
|
void pango_layout_get_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of layout. Logical extents
are usually what you want for positioning things. Note that both extents
may have non-zero x and y. You may want to use those to offset where you
render the layout. Not doing that is a very typical bug that shows up as
right-to-left layouts not being correctly positioned in a layout with
a set width.
The extents are given in layout coordinates and in Pango units; layout coordinates begin at the top left corner of the layout.
|
a PangoLayout |
|
rectangle used to store the extents of the layout as drawn
or NULL to indicate that the result is not needed.
|
|
rectangle used to store the logical extents of the layout
or NULL to indicate that the result is not needed.
|
void pango_layout_get_pixel_extents (PangoLayout *layout, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of layout in device units.
This function just calls pango_layout_get_extents() followed by
two pango_extents_to_pixels() calls, rounding ink_rect and logical_rect
such that the rounded rectangles fully contain the unrounded one (that is,
passes them as first argument to pango_extents_to_pixels()).
|
a PangoLayout |
|
rectangle used to store the extents of the layout as drawn
or NULL to indicate that the result is not needed.
|
|
rectangle used to store the logical extents of the
layout or NULL to indicate that the result is not needed.
|
void pango_layout_get_size (PangoLayout *layout, int *width, int *height);
Determines the logical width and height of a PangoLayout
in Pango units (device units scaled by PANGO_SCALE). This
is simply a convenience function around pango_layout_get_extents().
|
a PangoLayout |
|
location to store the logical width, or NULL
|
|
location to store the logical height, or NULL
|
void pango_layout_get_pixel_size (PangoLayout *layout, int *width, int *height);
Determines the logical width and height of a PangoLayout
in device units. (pango_layout_get_size() returns the width
and height scaled by PANGO_SCALE.) This
is simply a convenience function around
pango_layout_get_pixel_extents().
|
a PangoLayout |
|
location to store the logical width, or NULL
|
|
location to store the logical height, or NULL
|
int pango_layout_get_baseline (PangoLayout *layout);
Gets the Y position of baseline of the first line in layout.
|
a PangoLayout |
Returns : |
baseline of first line, from top of layout.
|
Since 1.22
int pango_layout_get_line_count (PangoLayout *layout);
Retrieves the count of lines for the layout.
|
PangoLayout |
Returns : |
the line count. |
PangoLayoutLine * pango_layout_get_line (PangoLayout *layout, int line);
Retrieves a particular line from a PangoLayout.
Use the faster pango_layout_get_line_readonly() if you do not plan
to modify the contents of the line (glyphs, glyph widths, etc.).
|
a PangoLayout |
|
the index of a line, which must be between 0 and
pango_layout_get_line_count(layout) - 1, inclusive.
|
Returns : |
the requested PangoLayoutLine, or NULL if the
index is out of range. This layout line can
be ref'ed and retained, but will become invalid
if changes are made to the PangoLayout.
|
PangoLayoutLine * pango_layout_get_line_readonly (PangoLayout *layout, int line);
Retrieves a particular line from a PangoLayout.
This is a faster alternative to pango_layout_get_line(),
but the user is not expected
to modify the contents of the line (glyphs, glyph widths, etc.).
|
a PangoLayout |
|
the index of a line, which must be between 0 and
pango_layout_get_line_count(layout) - 1, inclusive.
|
Returns : |
the requested PangoLayoutLine, or NULL if the
index is out of range. This layout line can
be ref'ed and retained, but will become invalid
if changes are made to the PangoLayout.
No changes should be made to the line.
|
Since 1.16
GSList * pango_layout_get_lines (PangoLayout *layout);
Returns the lines of the layout as a list.
Use the faster pango_layout_get_lines_readonly() if you do not plan
to modify the contents of the lines (glyphs, glyph widths, etc.).
|
a PangoLayout |
Returns : |
element-type Pango.LayoutLine): (transfer none. element-type Pango.LayoutLine): (transfer none. |
GSList * pango_layout_get_lines_readonly (PangoLayout *layout);
Returns the lines of the layout as a list.
This is a faster alternative to pango_layout_get_lines(),
but the user is not expected
to modify the contents of the lines (glyphs, glyph widths, etc.).
|
a PangoLayout |
Returns : |
element-type Pango.LayoutLine): (transfer none. element-type Pango.LayoutLine): (transfer none. |
Since 1.16
PangoLayoutIter * pango_layout_get_iter (PangoLayout *layout);
Returns an iterator to iterate over the visual extents of the layout.
|
a PangoLayout |
Returns : |
the new PangoLayoutIter that should be freed using
pango_layout_iter_free().
|
PangoLayoutIter * pango_layout_iter_copy (PangoLayoutIter *iter);
Copies a PangLayoutIter.
|
a PangoLayoutIter, may be NULL
|
Returns : |
the newly allocated PangoLayoutIter, which should
be freed with pango_layout_iter_free(), or NULL if
iter was NULL.
|
Since 1.20
void pango_layout_iter_free (PangoLayoutIter *iter);
Frees an iterator that's no longer in use.
|
a PangoLayoutIter, may be NULL
|
gboolean pango_layout_iter_next_run (PangoLayoutIter *iter);
Moves iter forward to the next run in visual order. If iter was
already at the end of the layout, returns FALSE.
|
a PangoLayoutIter |
Returns : |
whether motion was possible. |
gboolean pango_layout_iter_next_char (PangoLayoutIter *iter);
Moves iter forward to the next character in visual order. If iter was already at
the end of the layout, returns FALSE.
|
a PangoLayoutIter |
Returns : |
whether motion was possible. |
gboolean pango_layout_iter_next_cluster (PangoLayoutIter *iter);
Moves iter forward to the next cluster in visual order. If iter
was already at the end of the layout, returns FALSE.
|
a PangoLayoutIter |
Returns : |
whether motion was possible. |
gboolean pango_layout_iter_next_line (PangoLayoutIter *iter);
Moves iter forward to the start of the next line. If iter is
already on the last line, returns FALSE.
|
a PangoLayoutIter |
Returns : |
whether motion was possible. |
gboolean pango_layout_iter_at_last_line (PangoLayoutIter *iter);
Determines whether iter is on the last line of the layout.
|
a PangoLayoutIter |
Returns : |
TRUE if iter is on the last line.
|
int pango_layout_iter_get_index (PangoLayoutIter *iter);
Gets the current byte index. Note that iterating forward by char
moves in visual order, not logical order, so indexes may not be
sequential. Also, the index may be equal to the length of the text
in the layout, if on the NULL run (see pango_layout_iter_get_run()).
|
a PangoLayoutIter |
Returns : |
current byte index. |
int pango_layout_iter_get_baseline (PangoLayoutIter *iter);
Gets the Y position of the current line's baseline, in layout coordinates (origin at top left of the entire layout).
|
a PangoLayoutIter |
Returns : |
baseline of current line. |
PangoLayoutRun * pango_layout_iter_get_run (PangoLayoutIter *iter);
Gets the current run. When iterating by run, at the end of each
line, there's a position with a NULL run, so this function can return
NULL. The NULL run at the end of each line ensures that all lines have
at least one run, even lines consisting of only a newline.
Use the faster pango_layout_iter_get_run_readonly() if you do not plan
to modify the contents of the run (glyphs, glyph widths, etc.).
|
a PangoLayoutIter |
Returns : |
the current run. |
PangoLayoutRun * pango_layout_iter_get_run_readonly (PangoLayoutIter *iter);
Gets the current run. When iterating by run, at the end of each
line, there's a position with a NULL run, so this function can return
NULL. The NULL run at the end of each line ensures that all lines have
at least one run, even lines consisting of only a newline.
This is a faster alternative to pango_layout_iter_get_run(),
but the user is not expected
to modify the contents of the run (glyphs, glyph widths, etc.).
|
a PangoLayoutIter |
Returns : |
the current run, that should not be modified. |
Since 1.16
PangoLayoutLine * pango_layout_iter_get_line (PangoLayoutIter *iter);
Gets the current line.
Use the faster pango_layout_iter_get_line_readonly() if you do not plan
to modify the contents of the line (glyphs, glyph widths, etc.).
|
a PangoLayoutIter |
Returns : |
the current line. |
PangoLayoutLine * pango_layout_iter_get_line_readonly (PangoLayoutIter *iter);
Gets the current line for read-only access.
This is a faster alternative to pango_layout_iter_get_line(),
but the user is not expected
to modify the contents of the line (glyphs, glyph widths, etc.).
|
a PangoLayoutIter |
Returns : |
the current line, that should not be modified. |
Since 1.16
PangoLayout * pango_layout_iter_get_layout (PangoLayoutIter *iter);
Gets the layout associated with a PangoLayoutIter.
|
a PangoLayoutIter |
Returns : |
the layout associated with iter.
|
Since 1.20
void pango_layout_iter_get_char_extents (PangoLayoutIter *iter, PangoRectangle *logical_rect);
Gets the extents of the current character, in layout coordinates (origin is the top left of the entire layout). Only logical extents can sensibly be obtained for characters; ink extents make sense only down to the level of clusters.
|
a PangoLayoutIter |
|
rectangle to fill with logical extents |
void pango_layout_iter_get_cluster_extents
(PangoLayoutIter *iter,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
Gets the extents of the current cluster, in layout coordinates (origin is the top left of the entire layout).
|
a PangoLayoutIter |
|
rectangle to fill with ink extents, or NULL
|
|
rectangle to fill with logical extents, or NULL
|
void pango_layout_iter_get_run_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Gets the extents of the current run in layout coordinates (origin is the top left of the entire layout).
|
a PangoLayoutIter |
|
rectangle to fill with ink extents, or NULL
|
|
rectangle to fill with logical extents, or NULL
|
void pango_layout_iter_get_line_yrange (PangoLayoutIter *iter, int *y0_, int *y1_);
Divides the vertical space in the PangoLayout being iterated over
between the lines in the layout, and returns the space belonging to
the current line. A line's range includes the line's logical
extents, plus half of the spacing above and below the line, if
pango_layout_set_spacing() has been called to set layout spacing.
The Y positions are in layout coordinates (origin at top left of the
entire layout).
|
a PangoLayoutIter |
|
start of line |
|
end of line |
void pango_layout_iter_get_line_extents (PangoLayoutIter *iter, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Obtains the extents of the current line. ink_rect or logical_rect
can be NULL if you aren't interested in them. Extents are in layout
coordinates (origin is the top-left corner of the entire
PangoLayout). Thus the extents returned by this function will be
the same width/height but not at the same x/y as the extents
returned from pango_layout_line_get_extents().
|
a PangoLayoutIter |
|
rectangle to fill with ink extents, or NULL
|
|
rectangle to fill with logical extents, or NULL
|
void pango_layout_iter_get_layout_extents
(PangoLayoutIter *iter,
PangoRectangle *ink_rect,
PangoRectangle *logical_rect);
Obtains the extents of the PangoLayout being iterated
over. ink_rect or logical_rect can be NULL if you
aren't interested in them.
|
a PangoLayoutIter |
|
rectangle to fill with ink extents, or NULL
|
|
rectangle to fill with logical extents, or NULL
|
typedef struct {
PangoLayout *layout;
gint start_index; /* start of line as byte index into layout->text */
gint length; /* length of line in bytes */
GSList *runs;
guint is_paragraph_start : 1; /* TRUE if this is the first line of the paragraph */
guint resolved_dir : 3; /* Resolved PangoDirection of line */
} PangoLayoutLine;
The PangoLayoutLine structure represents one of the lines resulting
from laying out a paragraph via PangoLayout. PangoLayoutLine
structures are obtained by calling pango_layout_get_line() and
are only valid until the text, attributes, or settings of the
parent PangoLayout are modified.
Routines for rendering PangoLayout objects are provided in code specific to each rendering system.
PangoLayout * |
the parent layout for this line |
gint |
the start of the line as byte index into layout->text
|
gint |
the length of the line in bytes |
GSList * |
a list containing the runs of the line in visual order |
guint |
%TRUE if this is the first line of the paragraph |
guint |
the resolved PangoDirection of the line |
typedef PangoGlyphItem PangoLayoutRun;
The PangoLayoutRun structure represents a single run within a PangoLayoutLine; it is simply an alternate name for PangoGlyphItem. See the PangoGlyphItem docs for details on the fields.
PangoLayoutLine * pango_layout_line_ref (PangoLayoutLine *line);
Increase the reference count of a PangoLayoutLine by one.
|
a PangoLayoutLine, may be NULL
|
Returns : |
the line passed in. |
Since 1.10
void pango_layout_line_unref (PangoLayoutLine *line);
Decrease the reference count of a PangoLayoutLine by one. If the result is zero, the line and all associated memory will be freed.
|
a PangoLayoutLine |
void pango_layout_line_get_extents (PangoLayoutLine *line, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of a layout line. See
pango_font_get_glyph_extents() for details about the interpretation
of the rectangles.
|
a PangoLayoutLine |
|
rectangle used to store the extents of the glyph string
as drawn, or NULL
|
|
rectangle used to store the logical extents of the glyph
string, or NULL
|
void pango_layout_line_get_pixel_extents (PangoLayoutLine *layout_line, PangoRectangle *ink_rect, PangoRectangle *logical_rect);
Computes the logical and ink extents of layout_line in device units.
This function just calls pango_layout_line_get_extents() followed by
two pango_extents_to_pixels() calls, rounding ink_rect and logical_rect
such that the rounded rectangles fully contain the unrounded one (that is,
passes them as first argument to pango_extents_to_pixels()).
|
a PangoLayoutLine |
|
rectangle used to store the extents of the glyph string
as drawn, or NULL
|
|
rectangle used to store the logical extents of the glyph
string, or NULL
|
void pango_layout_line_index_to_x (PangoLayoutLine *line, int index_, gboolean trailing, int *x_pos);
Converts an index within a line to a X position.
|
a PangoLayoutLine |
|
byte offset of a grapheme within the layout |
|
an integer indicating the edge of the grapheme to retrieve the position of. If > 0, the trailing edge of the grapheme, if 0, the leading of the grapheme. |
|
location to store the x_offset (in Pango unit) |
gboolean pango_layout_line_x_to_index (PangoLayoutLine *line, int x_pos, int *index_, int *trailing);
Converts from x offset to the byte index of the corresponding
character within the text of the layout. If x_pos is outside the line,
index_ and trailing will point to the very first or very last position
in the line. This determination is based on the resolved direction
of the paragraph; for example, if the resolved direction is
right-to-left, then an X position to the right of the line (after it)
results in 0 being stored in index_ and trailing. An X position to the
left of the line results in index_ pointing to the (logical) last
grapheme in the line and trailing being set to the number of characters
in that grapheme. The reverse is true for a left-to-right line.
|
a PangoLayoutLine |
|
the X offset (in Pango units) from the left edge of the line. |
|
location to store calculated byte index for the grapheme in which the user clicked. |
|
location to store an integer indicating where in the grapheme the user clicked. It will either be zero, or the number of characters in the grapheme. 0 represents the leading edge of the grapheme. |
Returns : |
FALSE if x_pos was outside the line, TRUE if inside
|
void pango_layout_line_get_x_ranges (PangoLayoutLine *line, int start_index, int end_index, int **ranges, int *n_ranges);
Gets a list of visual ranges corresponding to a given logical range. This list is not necessarily minimal - there may be consecutive ranges which are adjacent. The ranges will be sorted from left to right. The ranges are with respect to the left edge of the entire layout, not with respect to the line.
|
a PangoLayoutLine |
|
Start byte index of the logical range. If this value is less than the start index for the line, then the first range will extend all the way to the leading edge of the layout. Otherwise it will start at the leading edge of the first character. |
|
Ending byte index of the logical range. If this value is greater than the end index for the line, then the last range will extend all the way to the trailing edge of the layout. Otherwise, it will end at the trailing edge of the last character. |
|
out): (array length=n_ranges): (transfer=full. out): (array length=n_ranges): (transfer=full. |
|
The number of ranges stored in ranges.
|
| Pango Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | ||||
PangoCairoFont;
PangoCairoFontMap;
PangoFontMap * pango_cairo_font_map_get_default (void);
void pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap);
PangoFontMap * pango_cairo_font_map_new (void);
PangoFontMap * pango_cairo_font_map_new_for_font_type
(cairo_font_type_t fonttype);
cairo_font_type_t pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap);
void pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap,
double dpi);
double pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap);
PangoContext * pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap);
cairo_scaled_font_t * pango_cairo_font_get_scaled_font (PangoCairoFont *font);
void pango_cairo_context_set_resolution (PangoContext *context,
double dpi);
double pango_cairo_context_get_resolution (PangoContext *context);
void pango_cairo_context_set_font_options
(PangoContext *context,
const cairo_font_options_t *options);
const cairo_font_options_t * pango_cairo_context_get_font_options
(PangoContext *context);
void (*PangoCairoShapeRendererFunc) (cairo_t *cr,
PangoAttrShape *attr,
gboolean do_path,
gpointer data);
void pango_cairo_context_set_shape_renderer
(PangoContext *context,
PangoCairoShapeRendererFunc func,
gpointer data,
GDestroyNotify dnotify);
PangoCairoShapeRendererFunc pango_cairo_context_get_shape_renderer
(PangoContext *context,
gpointer *data);
PangoContext * pango_cairo_create_context (cairo_t *cr);
void pango_cairo_update_context (cairo_t *cr,
PangoContext *context);
PangoLayout * pango_cairo_create_layout (cairo_t *cr);
void pango_cairo_update_layout (cairo_t *cr,
PangoLayout *layout);
void pango_cairo_show_glyph_string (cairo_t *cr,
PangoFont *font,
PangoGlyphString *glyphs);
void pango_cairo_show_glyph_item (cairo_t *cr,
const char *text,
PangoGlyphItem *glyph_item);
void pango_cairo_show_layout_line (cairo_t *cr,
PangoLayoutLine *line);
void pango_cairo_show_layout (cairo_t *cr,
PangoLayout *layout);
void pango_cairo_show_error_underline (cairo_t *cr,
double x,
double y,
double width,
double height);
void pango_cairo_glyph_string_path (cairo_t *cr,
PangoFont *font,
PangoGlyphString *glyphs);
void pango_cairo_layout_line_path (cairo_t *cr,
PangoLayoutLine *line);
void pango_cairo_layout_path (cairo_t *cr,
PangoLayout *layout);
void pango_cairo_error_underline_path (cairo_t *cr,
double x,
double y,
double width,
double height);
The Cairo library is a vector graphics library with a powerful rendering model. It has such features as anti-aliased primitives, alpha-compositing, and gradients. Multiple backends for Cairo are available, to allow rendering to images, to PDF files, and to the screen on X and on other windowing systems. The functions in this section allow using Pango to render to Cairo surfaces.
Using Pango with Cairo is straightforward. A PangoContext created
with pango_cairo_font_map_create_context() can be used on any
Cairo context (cairo_t), but needs to be updated to match the
current transformation matrix and target surface of the Cairo context
using pango_cairo_update_context(). The convenience functions
pango_cairo_create_layout() and pango_cairo_update_layout() handle
the common case where the program doesn't need to manipulate the
properties of the PangoContext.
When you get the metrics of a layout or of a piece of a layout using
functions such as pango_layout_get_extents(), the reported metrics
are in user-space coordinates. If a piece of text is 10 units long,
and you call cairo_scale (cr, 2.0), it still is more-or-less 10
units long. However, the results will be affected by hinting
(that is, the process of adjusting the text to look good on the
pixel grid), so you shouldn't assume they are completely independent
of the current transformation matrix. Note that the basic metrics
functions in Pango report results in integer Pango units. To get
to the floating point units used in Cairo divide by PANGO_SCALE.
Example 1. Using Pango with Cairo
#include <math.h>
#include <pango/pangocairo.h>
static void
draw_text (cairo_t *cr)
{
#define RADIUS 150
#define N_WORDS 10
#define FONT "Sans Bold 27"
PangoLayout *layout;
PangoFontDescription *desc;
int i;
/* Center coordinates on the middle of the region we are drawing
*/
cairo_translate (cr, RADIUS, RADIUS);
/* Create a PangoLayout, set the font and text */
layout = pango_cairo_create_layout (cr);
pango_layout_set_text (layout, "Text", -1);
desc = pango_font_description_from_string (FONT);
pango_layout_set_font_description (layout, desc);
pango_font_description_free (desc);
/* Draw the layout N_WORDS times in a circle */
for (i = 0; i < N_WORDS; i++)
{
int width, height;
double angle = (360. * i) / N_WORDS;
double red;
cairo_save (cr);
/* Gradient from red at angle == 60 to blue at angle == 240 */
red = (1 + cos ((angle - 60) * G_PI / 180.)) / 2;
cairo_set_source_rgb (cr, red, 0, 1.0 - red);
cairo_rotate (cr, angle * G_PI / 180.);
/* Inform Pango to re-layout the text with the new transformation */
pango_cairo_update_layout (cr, layout);
pango_layout_get_size (layout, &width, &height);
cairo_move_to (cr, - ((double)width / PANGO_SCALE) / 2, - RADIUS);
pango_cairo_show_layout (cr, layout);
cairo_restore (cr);
}
/* free the layout object */
g_object_unref (layout);
}
int main (int argc, char **argv)
{
cairo_t *cr;
char *filename;
cairo_status_t status;
cairo_surface_t *surface;
if (argc != 2)
{
g_printerr ("Usage: cairosimple OUTPUT_FILENAME\n");
return 1;
}
filename = argv[1];
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
2 * RADIUS, 2 * RADIUS);
cr = cairo_create (surface);
cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
cairo_paint (cr);
draw_text (cr);
cairo_destroy (cr);
status = cairo_surface_write_to_png (surface, filename);
cairo_surface_destroy (surface);
if (status != CAIRO_STATUS_SUCCESS)
{
g_printerr ("Could not save png to '%s'\n", filename);
return 1;
}
return 0;
}
typedef struct _PangoCairoFont PangoCairoFont;
PangoCairoFont is an interface exported by fonts for use with Cairo. The actual type of the font will depend on the particular font technology Cairo was compiled to use.
Since 1.18
typedef struct _PangoCairoFontMap PangoCairoFontMap;
PangoCairoFontMap is an interface exported by font maps for use with Cairo. The actual type of the font map will depend on the particular font technology Cairo was compiled to use.
Since 1.10
PangoFontMap * pango_cairo_font_map_get_default (void);
Gets a default PangoCairoFontMap to use with Cairo.
Note that the type of the returned object will depend on the particular font backend Cairo was compiled to use; You generally should only use the PangoFontMap and PangoCairoFontMap interfaces on the returned object.
The default Cairo fontmap can be changed by using
pango_cairo_font_map_set_default(). This can be used to
change the Cairo font backend that the default fontmap
uses for example.
Returns : |
the default Cairo fontmap for Pango. This object is owned by Pango and must not be freed. |
Since 1.10
void pango_cairo_font_map_set_default (PangoCairoFontMap *fontmap);
Sets a default PangoCairoFontMap to use with Cairo.
This can be used to change the Cairo font backend that the default fontmap uses for example. The old default font map is unreffed and the new font map referenced.
A value of NULL for fontmap will cause the current default
font map to be released and a new default font
map to be created on demand, using pango_cairo_font_map_new().
|
The new default font map, or NULL
|
Since 1.22
PangoFontMap * pango_cairo_font_map_new (void);
Creates a new PangoCairoFontMap object; a fontmap is used
to cache information about available fonts, and holds
certain global parameters such as the resolution.
In most cases, you can use pango_cairo_font_map_get_default()
instead.
Note that the type of the returned object will depend on the particular font backend Cairo was compiled to use; You generally should only use the PangoFontMap and PangoCairoFontMap interfaces on the returned object.
Returns : |
the newly allocated PangoFontMap, which should
be freed with g_object_unref().
|
Since 1.10
PangoFontMap * pango_cairo_font_map_new_for_font_type (cairo_font_type_t fonttype);
Creates a new PangoCairoFontMap object of the type suitable
to be used with cairo font backend of type fonttype.
In most cases one should simply use @pango_cairo_font_map_new(),
or in fact in most of those cases, just use
@pango_cairo_font_map_get_default().
|
desired cairo_font_type_t |
Returns : |
the newly allocated PangoFontMap of suitable type
which should be freed with g_object_unref(),
or NULL if the requested cairo font backend is
not supported / compiled in.
|
Since 1.18
cairo_font_type_t pango_cairo_font_map_get_font_type (PangoCairoFontMap *fontmap);
Gets the type of Cairo font backend that fontmap uses.
|
a PangoCairoFontMap |
Returns : |
the cairo_font_type_t cairo font backend type |
Since 1.18
void pango_cairo_font_map_set_resolution (PangoCairoFontMap *fontmap, double dpi);
Sets the resolution for the fontmap. This is a scale factor between points specified in a PangoFontDescription and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).
|
a PangoCairoFontMap |
|
the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.) |
Since 1.10
double pango_cairo_font_map_get_resolution (PangoCairoFontMap *fontmap);
Gets the resolution for the fontmap. See pango_cairo_font_map_set_resolution()
|
a PangoCairoFontMap |
Returns : |
the resolution in "dots per inch" |
Since 1.10
PangoContext * pango_cairo_font_map_create_context (PangoCairoFontMap *fontmap);
pango_cairo_font_map_create_context has been deprecated since version 1.22 and should not be used in newly-written code. Use pango_font_map_create_context() instead.
Create a PangoContext for the given fontmap.
|
a PangoCairoFontMap |
Returns : |
the newly created context; free with g_object_unref().
|
Since 1.10
cairo_scaled_font_t * pango_cairo_font_get_scaled_font (PangoCairoFont *font);
Gets the cairo_scaled_font_t used by font.
The scaled font can be referenced and kept using
cairo_scaled_font_reference().
|
a PangoFont from a PangoCairoFontMap |
Returns : |
the cairo_scaled_font_t used by font,
or NULL if font is NULL.
|
Since 1.18
void pango_cairo_context_set_resolution (PangoContext *context, double dpi);
Sets the resolution for the context. This is a scale factor between points specified in a PangoFontDescription and Cairo units. The default value is 96, meaning that a 10 point font will be 13 units high. (10 * 96. / 72. = 13.3).
|
a PangoContext, from a pangocairo font map |
|
the resolution in "dots per inch". (Physical inches aren't actually involved; the terminology is conventional.) A 0 or negative value means to use the resolution from the font map. |
Since 1.10
double pango_cairo_context_get_resolution (PangoContext *context);
Gets the resolution for the context. See pango_cairo_context_set_resolution()
|
a PangoContext, from a pangocairo font map |
Returns : |
the resolution in "dots per inch". A negative value will be returned if no resolution has previously been set. |
Since 1.10
void pango_cairo_context_set_font_options
(PangoContext *context,
const cairo_font_options_t *options);
Sets the font options used when rendering text with this context.
These options override any options that pango_cairo_update_context()
derives from the target surface.
|
a PangoContext, from a pangocairo font map |
|
a cairo_font_options_t, or NULL to unset any previously set
options. A copy is made.
|
Since 1.10
const cairo_font_options_t * pango_cairo_context_get_font_options (PangoContext *context);
Retrieves any font rendering options previously set with
pango_cairo_font_map_set_font_options(). This function does not report options
that are derived from the target surface by pango_cairo_update_context()
|
a PangoContext, from a pangocairo font map |
Returns : |
the font options previously set on the context, or NULL
if no options have been set. This value is owned by the context
and must not be modified or freed.
|
Since 1.10
void (*PangoCairoShapeRendererFunc) (cairo_t *cr, PangoAttrShape *attr, gboolean do_path, gpointer data);
Function type for rendering attributes of type PANGO_ATTR_SHAPE
with Pango's Cairo renderer.
|
a Cairo context with current point set to where the shape should be rendered |
|
the PANGO_ATTR_SHAPE to render
|
|
whether only the shape path should be appended to current
path of cr and no filling/stroking done. This will be set
to TRUE when called from pango_cairo_layout_path() and
pango_cairo_layout_line_path() rendering functions.
|
|
user data passed to pango_cairo_context_set_shape_renderer()
|
void pango_cairo_context_set_shape_renderer
(PangoContext *context,
PangoCairoShapeRendererFunc func,
gpointer data,
GDestroyNotify dnotify);
Sets callback function for context to use for rendering attributes
of type PANGO_ATTR_SHAPE. See PangoCairoShapeRendererFunc for
details.
|
a PangoContext, from a pangocairo font map |
|
Callback function for rendering attributes of type
PANGO_ATTR_SHAPE, or NULL to disable shape rendering.
|
|
User data that will be passed to func.
|
|
Callback that will be called when the
context is freed to release data, or NULL.
|
Since 1.18
PangoCairoShapeRendererFunc pango_cairo_context_get_shape_renderer (PangoContext *context, gpointer *data);
Sets callback function for context to use for rendering attributes
of type PANGO_ATTR_SHAPE. See PangoCairoShapeRendererFunc for
details.
Retrieves callback function and associated user data for rendering
attributes of type PANGO_ATTR_SHAPE as set by
pango_cairo_context_set_shape_renderer(), if any.
|
a PangoContext, from a pangocairo font map |
|
Pointer to gpointer to return user data |
Returns : |
the shape rendering callback previously set on the context, or NULL
if no shape rendering callback have been set.
|
Since 1.18
PangoContext * pango_cairo_create_context (cairo_t *cr);
Creates a context object set up to match the current transformation
and target surface of the Cairo context. This context can then be
used to create a layout using pango_layout_new().
This function is a convenience function that creates a context using
the default font map, then updates it to cr. If you just need to
create a layout for use with cr and do not need to access PangoContext
directly, you can use pango_cairo_create_layout() instead.
|
a Cairo context |
Returns : |
the newly created PangoContext. Free with
g_object_unref().
|
Since 1.22
void pango_cairo_update_context (cairo_t *cr, PangoContext *context);
Updates a PangoContext previously created for use with Cairo to
match the current transformation and target surface of a Cairo
context. If any layouts have been created for the context,
it's necessary to call pango_layout_context_changed() on those
layouts.
|
a Cairo context |
|
a PangoContext, from a pangocairo font map |
Since 1.10
PangoLayout * pango_cairo_create_layout (cairo_t *cr);
Creates a layout object set up to match the current transformation
and target surface of the Cairo context. This layout can then be
used for text measurement with functions like
pango_layout_get_size() or drawing with functions like
pango_cairo_show_layout(). If you change the transformation
or target surface for cr, you need to call pango_cairo_update_layout()
This function is the most convenient way to use Cairo with Pango, however it is slightly inefficient since it creates a separate PangoContext object for each layout. This might matter in an application that was laying out large amounts of text.
|
a Cairo context |
Returns : |
the newly created PangoLayout. Free with
g_object_unref().
|
Since 1.10
void pango_cairo_update_layout (cairo_t *cr, PangoLayout *layout);
Updates the private PangoContext of a PangoLayout created with
pango_cairo_create_layout() to match the current transformation
and target surface of a Cairo context.
|
a Cairo context |
|
a PangoLayout, from pango_cairo_create_layout()
|
Since 1.10
void pango_cairo_show_glyph_string (cairo_t *cr, PangoFont *font, PangoGlyphString *glyphs);
Draws the glyphs in glyphs in the specified cairo context.
The origin of the glyphs (the left edge of the baseline) will
be drawn at the current point of the cairo context.
|
a Cairo context |
|
a PangoFont from a PangoCairoFontMap |
|
a PangoGlyphString |
Since 1.10
void pango_cairo_show_glyph_item (cairo_t *cr, const char *text, PangoGlyphItem *glyph_item);
Draws the glyphs in glyph_item in the specified cairo context,
embedding the text associated with the glyphs in the output if the
output format supports it (PDF for example), otherwise it acts
similar to pango_cairo_show_glyph_string().
The origin of the glyphs (the left edge of the baseline) will be drawn at the current point of the cairo context.
Note that text is the start of the text for layout, which is then
indexed by .glyph_item->item->offset
|
a Cairo context |
|
the UTF-8 text that glyph_item refers to
|
|
a PangoGlyphItem |
Since 1.22
void pango_cairo_show_layout_line (cairo_t *cr, PangoLayoutLine *line);
Draws a PangoLayoutLine in the specified cairo context. The origin of the glyphs (the left edge of the line) will be drawn at the current point of the cairo context.
|
a Cairo context |
|
a PangoLayoutLine |
Since 1.10
void pango_cairo_show_layout (cairo_t *cr, PangoLayout *layout);
Draws a PangoLayoutLine in the specified cairo context. The top-left corner of the PangoLayout will be drawn at the current point of the cairo context.
|
a Cairo context |
|
a Pango layout |
Since 1.10
void pango_cairo_show_error_underline (cairo_t *cr, double x, double y, double width, double height);
Draw a squiggly line in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle)
|
a Cairo context |
|
The X coordinate of one corner of the rectangle |
|
The Y coordinate of one corner of the rectangle |
|
Non-negative width of the rectangle |
|
Non-negative height of the rectangle |
Since 1.14
void pango_cairo_glyph_string_path (cairo_t *cr, PangoFont *font, PangoGlyphString *glyphs);
Adds the glyphs in glyphs to the current path in the specified
cairo context. The origin of the glyphs (the left edge of the baseline)
will be at the current point of the cairo context.
|
a Cairo context |
|
a PangoFont from a PangoCairoFontMap |
|
a PangoGlyphString |
Since 1.10
void pango_cairo_layout_line_path (cairo_t *cr, PangoLayoutLine *line);
Adds the text in PangoLayoutLine to the current path in the specified cairo context. The origin of the glyphs (the left edge of the line) will be at the current point of the cairo context.
|
a Cairo context |
|
a PangoLayoutLine |
Since 1.10
void pango_cairo_layout_path (cairo_t *cr, PangoLayout *layout);
Adds the text in a PangoLayout to the current path in the specified cairo context. The top-left corner of the PangoLayout will be at the current point of the cairo context.
|
a Cairo context |
|
a Pango layout |
Since 1.10
void pango_cairo_error_underline_path (cairo_t *cr, double x, double y, double width, double height);
Add a squiggly line to the current path in the specified cairo context that approximately covers the given rectangle in the style of an underline used to indicate a spelling error. (The width of the underline is rounded to an integer number of up/down segments and the resulting rectangle is centered in the original rectangle)
|
a Cairo context |
|
The X coordinate of one corner of the rectangle |
|
The Y coordinate of one corner of the rectangle |
|
Non-negative width of the rectangle |
|
Non-negative height of the rectangle |
Since 1.14