gdkfont-win32.c File Reference

#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include "gdkfont.h"
#include "gdkwin32.h"

Go to the source code of this file.

Classes

struct  gdk_text_size_arg

Defines

#define set_bit(bitno)   (fsp->fsUsb[(bitno)/32] |= (1 << ((bitno) % 32)))
#define check_cp(bit)   (fsp->fsCsb[0] & (bit))

Enumerations

enum  unicode_subset

Functions

static void gdk_font_hash_insert (GdkFontType type, GdkFont *font, const gchar *font_name)
static void gdk_font_hash_remove (GdkFontType type, GdkFont *font)
static GdkFontgdk_font_hash_lookup (GdkFontType type, const gchar *font_name)
static const char * charset_name (DWORD charset)
static gcharlogfont_to_xlfd (const LOGFONT *lfp, int size, int res, int avg_width)
gchargdk_font_full_name_get (GdkFont *font)
void gdk_font_full_name_free (gchar *name)
static gboolean pattern_match (const gchar *pattern, const gchar *string)
static int CALLBACK InnerEnumFontFamExProc (const LOGFONT *lfp, const TEXTMETRIC *metrics, DWORD fontType, LPARAM lParam)
static int CALLBACK EnumFontFamExProc (const LOGFONT *lfp, const TEXTMETRIC *metrics, DWORD fontType, LPARAM lParam)
gchar ** gdk_font_list_new (const gchar *font_pattern, gint *n_returned)
void gdk_font_list_free (gchar **font_list)
static void print_unicode_subranges (FONTSIGNATURE *fsp)
static gboolean check_unicode_subranges (UINT charset, FONTSIGNATURE *fsp)
GdkWin32SingleFontgdk_font_load_internal (const gchar *font_name)
GdkFontgdk_font_load (const gchar *font_name)
GdkFontgdk_fontset_load (const gchar *fontset_name)
void _gdk_font_destroy (GdkFont *font)
gint _gdk_font_strlen (GdkFont *font, const gchar *str)
gint gdk_font_id (const GdkFont *font)
gint gdk_font_equal (const GdkFont *fonta, const GdkFont *fontb)
static int unicode_classify (wchar_t wc)
void gdk_wchar_text_handle (GdkFont *font, const wchar_t *wcstr, int wclen, void(*handler)(GdkWin32SingleFont *, const wchar_t *, int, void *), void *arg)
static void gdk_text_size_handler (GdkWin32SingleFont *singlefont, const wchar_t *wcstr, int wclen, void *argp)
static gboolean gdk_text_size (GdkFont *font, const gchar *text, gint text_length, gdk_text_size_arg *arg)
gint gdk_text_width (GdkFont *font, const gchar *text, gint text_length)
gint gdk_text_width_wc (GdkFont *font, const GdkWChar *text, gint text_length)
void gdk_text_extents (GdkFont *font, const gchar *text, gint text_length, gint *lbearing, gint *rbearing, gint *width, gint *ascent, gint *descent)
void gdk_text_extents_wc (GdkFont *font, const GdkWChar *text, gint text_length, gint *lbearing, gint *rbearing, gint *width, gint *ascent, gint *descent)

Variables

static GHashTablefont_name_hash = NULL
static GHashTablefontset_name_hash = NULL
static float gfont_angle = 0.0
static gint num_fonts
static gint font_names_size
static gchar ** xfontnames
struct {
   wchar_t   low
   wchar_t   high
   unicode_subset   bit
   gchar *   name
utab []


Define Documentation

#define check_cp ( bit   )     (fsp->fsCsb[0] & (bit))

Referenced by check_unicode_subranges().

#define set_bit ( bitno   )     (fsp->fsUsb[(bitno)/32] |= (1 << ((bitno) % 32)))

Referenced by check_unicode_subranges(), set_bit(), and set_start_bits().


Enumeration Type Documentation

enum unicode_subset

Definition at line 443 of file gdkfont-win32.c.


Function Documentation

void _gdk_font_destroy ( GdkFont font  ) 

Definition at line 1495 of file gdkfont-win32.c.

References g_free(), g_print(), g_slist_free(), GDK_FONT_FONT, GDK_FONT_FONTSET, gdk_font_hash_remove(), GDK_NOTE, list, private, _GdkFont::type, and _GdkWin32SingleFont::xfont.

Referenced by gdk_font_unref().

gint _gdk_font_strlen ( GdkFont font,
const gchar str 
)

Definition at line 1525 of file gdkfont-win32.c.

References g_return_val_if_fail, and NULL.

static const char* charset_name ( DWORD  charset  )  [static]

Definition at line 92 of file gdkfont-win32.c.

References JOHAB_CHARSET, and VIETNAMESE_CHARSET.

Referenced by gdk_font_load_internal(), and logfont_to_xlfd().

static gboolean check_unicode_subranges ( UINT  charset,
FONTSIGNATURE *  fsp 
) [static]

Definition at line 646 of file gdkfont-win32.c.

References bit, check_cp, define(), FALSE, FS_VIETNAMESE, g_print(), GDK_NOTE, i, if(), JOHAB_CHARSET, retval, set_bit, TRUE, U_ALPHABETIC_PRESENTATION_FORMS, U_ARABIC_EXTENDED, U_ARABIC_PRESENTATION_FORMS_B, U_ARROWS, U_BASIC_ARABIC, U_BASIC_GREEK, U_BASIC_HEBREW, U_BASIC_LATIN, U_BLOCK_ELEMENTS, U_BOPOMOFO, U_BOX_DRAWING, U_CJK_COMPATIBILITY, U_CJK_COMPATIBILITY_FORMS, U_CJK_COMPATIBILITY_IDEOGRAPHS, U_CJK_MISCELLANEOUS, U_CJK_SYMBOLS_AND_PUNCTUATION, U_CJK_UNIFIED_IDEOGRAPHS, U_COMBINING_DIACRITICAL_MARKS, U_COMBINING_DIACRITICAL_MARKS_FOR_SYMBOLS, U_CURRENCY_SYMBOLS, U_CYRILLIC, U_ENCLOSED_ALPHANUMERICS, U_ENCLOSED_CJK, U_GENERAL_PUNCTUATION, U_GEOMETRIC_SHAPES, U_HALFWIDTH_AND_FULLWIDTH_FORMS, U_HANGUL, U_HANGUL_COMPATIBILITY_JAMO, U_HANGUL_JAMO, U_HANGUL_SUPPLEMENTARY_A, U_HEBREW_EXTENDED, U_HIRAGANA, U_KATAKANA, U_LAST_PLUS_ONE, U_LATIN_1_SUPPLEMENT, U_LATIN_EXTENDED_A, U_LATIN_EXTENDED_ADDITIONAL, U_LATIN_EXTENDED_B, U_LETTERLIKE_SYMBOLS, U_MATHEMATICAL_OPERATORS, U_MISCELLANEOUS_SYMBOLS, U_MISCELLANEOUS_TECHNICAL, U_NUMBER_FORMS, U_PRIVATE_USE_AREA, U_SMALL_FORM_VARIANTS, U_SPACING_MODIFIER_LETTERS, U_SPECIALS, U_SUPERSCRIPTS_AND_SUBSCRIPTS, U_THAI, and VIETNAMESE_CHARSET.

Referenced by gdk_font_load_internal().

static int CALLBACK EnumFontFamExProc ( const LOGFONT *  lfp,
const TEXTMETRIC *  metrics,
DWORD  fontType,
LPARAM  lParam 
) [static]

Definition at line 388 of file gdkfont-win32.c.

References gdk_DC, and InnerEnumFontFamExProc().

Referenced by gdk_font_list_new().

gint gdk_font_equal ( const GdkFont fonta,
const GdkFont fontb 
)

Definition at line 1547 of file gdkfont-win32.c.

References FALSE, _GdkFontPrivateWin32::fonts, g_return_val_if_fail, GDK_FONT_FONT, GDK_FONT_FONTSET, NULL, and _GdkFont::type.

void gdk_font_full_name_free ( gchar name  ) 

Definition at line 303 of file gdkfont-win32.c.

References g_free().

Referenced by gdk_win32_gc_values_to_win32values().

gchar* gdk_font_full_name_get ( GdkFont font  ) 

Definition at line 266 of file gdkfont-win32.c.

References FALSE, g_free(), g_return_val_if_fail, g_string_append(), g_string_append_c(), g_string_free(), g_string_new(), gchar, if(), list, logfont_to_xlfd(), NULL, result(), WIN32_GDI_FAILED, and _GdkWin32SingleFont::xfont.

Referenced by gdk_win32_gc_values_to_win32values().

static void gdk_font_hash_insert ( GdkFontType  type,
GdkFont font,
const gchar font_name 
) [static]

Definition at line 41 of file gdkfont-win32.c.

References font_name_hash, fontset_name_hash, g_hash_table_insert(), g_hash_table_new(), g_slist_prepend(), g_str_equal(), g_str_hash(), g_strdup(), GDK_FONT_FONT, and private.

Referenced by gdk_font_load(), and gdk_fontset_load().

static GdkFont* gdk_font_hash_lookup ( GdkFontType  type,
const gchar font_name 
) [static]

Definition at line 74 of file gdkfont-win32.c.

References font_name_hash, fontset_name_hash, g_hash_table_lookup(), GDK_FONT_FONT, gdk_font_ref(), hash, NULL, and result().

Referenced by gdk_font_load(), and gdk_fontset_load().

static void gdk_font_hash_remove ( GdkFontType  type,
GdkFont font 
) [static]

Definition at line 55 of file gdkfont-win32.c.

References font_name_hash, fontset_name_hash, g_free(), g_hash_table_remove(), g_slist_free(), GDK_FONT_FONT, hash, NULL, and private.

Referenced by _gdk_font_destroy().

gint gdk_font_id ( const GdkFont font  ) 

Definition at line 1533 of file gdkfont-win32.c.

References g_return_val_if_fail, GDK_FONT_FONT, NULL, private, and _GdkFont::type.

void gdk_font_list_free ( gchar **  font_list  ) 

Definition at line 426 of file gdkfont-win32.c.

References g_strfreev().

Referenced by TGWin32::FreeFontNames().

gchar** gdk_font_list_new ( const gchar font_pattern,
gint n_returned 
)

Definition at line 404 of file gdkfont-win32.c.

References EnumFontFamExProc(), font_names_size, g_free(), g_new, gchar, gdk_DC, memmove, NULL, num_fonts, result(), and xfontnames.

Referenced by TGWin32::ListFonts().

GdkFont* gdk_font_load ( const gchar font_name  ) 

Definition at line 1382 of file gdkfont-win32.c.

References _GdkFont::ascent, _GdkFont::descent, g_new, g_print(), g_return_val_if_fail, g_slist_append(), gdk_DC, GDK_FONT_FONTSET, gdk_font_hash_insert(), gdk_font_hash_lookup(), gdk_font_load_internal(), GDK_NOTE, HANDLE, NULL, _GdkFont::type, and _GdkWin32SingleFont::xfont.

Referenced by TGWin32::LoadQueryFont().

GdkWin32SingleFont* gdk_font_load_internal ( const gchar font_name  ) 

Definition at line 1059 of file gdkfont-win32.c.

References c, _GdkWin32SingleFont::charset, charset_name(), check_unicode_subranges(), _GdkWin32SingleFont::codepage, DWORD, FALSE, _GdkWin32SingleFont::fs, g_filename_from_utf8(), g_free(), g_new, g_print(), g_return_val_if_fail, g_strcasecmp(), g_warning(), gchar, gdk_DC, GDK_NOTE, gfont_angle, int, JOHAB_CHARSET, NULL, p, print_unicode_subranges(), res_x, res_y, strcpy(), TRUE, and _GdkWin32SingleFont::xfont.

Referenced by gdk_font_load(), and gdk_fontset_load().

GdkFont* gdk_fontset_load ( const gchar fontset_name  ) 

Definition at line 1425 of file gdkfont-win32.c.

References _GdkFont::ascent, b, _GdkFont::descent, g_free(), g_new, g_return_val_if_fail, g_slist_append(), g_strdup(), gchar, gdk_DC, GDK_FONT_FONTSET, gdk_font_hash_insert(), gdk_font_hash_lookup(), gdk_font_load_internal(), HANDLE, MAX, NULL, p, private, s, TRUE, _GdkFont::type, and _GdkWin32SingleFont::xfont.

void gdk_text_extents ( GdkFont font,
const gchar text,
gint  text_length,
gint lbearing,
gint rbearing,
gint width,
gint ascent,
gint descent 
)

Definition at line 1765 of file gdkfont-win32.c.

References _GdkFont::descent, g_assert, g_free(), g_new, g_return_if_fail, g_warning(), GDK_FONT_FONT, GDK_FONT_FONTSET, gdk_nmbstowchar_ts(), gdk_text_size_handler(), gdk_wchar_text_handle(), NULL, gdk_text_size_arg::total, and _GdkFont::type.

Referenced by gdk_string_extents(), gdk_text_height(), and gdk_text_measure().

void gdk_text_extents_wc ( GdkFont font,
const GdkWChar text,
gint  text_length,
gint lbearing,
gint rbearing,
gint width,
gint ascent,
gint descent 
)

Definition at line 1828 of file gdkfont-win32.c.

References _GdkFont::descent, g_assert, g_free(), g_new, g_return_if_fail, GDK_FONT_FONT, GDK_FONT_FONTSET, gdk_text_size_handler(), gdk_wchar_text_handle(), i, NULL, gdk_text_size_arg::total, and _GdkFont::type.

static gboolean gdk_text_size ( GdkFont font,
const gchar text,
gint  text_length,
gdk_text_size_arg arg 
) [static]

Definition at line 1683 of file gdkfont-win32.c.

References FALSE, g_assert, g_free(), g_new, g_return_val_if_fail, g_warning(), GDK_FONT_FONT, GDK_FONT_FONTSET, gdk_nmbstowchar_ts(), gdk_text_size_handler(), gdk_wchar_text_handle(), NULL, TRUE, and _GdkFont::type.

Referenced by gdk_text_width().

static void gdk_text_size_handler ( GdkWin32SingleFont singlefont,
const wchar_t *  wcstr,
int  wclen,
void *  argp 
) [static]

Definition at line 1661 of file gdkfont-win32.c.

References gdk_DC, MAX, NULL, gdk_text_size_arg::total, WIN32_GDI_FAILED, and _GdkWin32SingleFont::xfont.

Referenced by gdk_text_extents(), gdk_text_extents_wc(), gdk_text_size(), and gdk_text_width_wc().

gint gdk_text_width ( GdkFont font,
const gchar text,
gint  text_length 
)

Definition at line 1719 of file gdkfont-win32.c.

References gdk_text_size(), and gdk_text_size_arg::total.

Referenced by gdk_char_width(), gdk_string_width(), and TGWin32::TextWidth().

gint gdk_text_width_wc ( GdkFont font,
const GdkWChar text,
gint  text_length 
)

Definition at line 1732 of file gdkfont-win32.c.

References g_assert, g_free(), g_new, g_return_val_if_fail, GDK_FONT_FONT, GDK_FONT_FONTSET, gdk_text_size_handler(), gdk_wchar_text_handle(), i, NULL, gdk_text_size_arg::total, and _GdkFont::type.

Referenced by gdk_char_width_wc().

void gdk_wchar_text_handle ( GdkFont font,
const wchar_t *  wcstr,
int  wclen,
void(*)(GdkWin32SingleFont *, const wchar_t *, int, void *)  handler,
void *  arg 
)

Definition at line 1604 of file gdkfont-win32.c.

References _GdkWin32SingleFont::fs, g_assert, g_print(), GDK_NOTE, i, if(), list, NULL, private, start, and unicode_classify().

Referenced by gdk_text_extents(), gdk_text_extents_wc(), gdk_text_size(), gdk_text_width_wc(), gdk_win32_draw_text(), and gdk_win32_draw_text_wc().

static int CALLBACK InnerEnumFontFamExProc ( const LOGFONT *  lfp,
const TEXTMETRIC *  metrics,
DWORD  fontType,
LPARAM  lParam 
) [static]

Definition at line 356 of file gdkfont-win32.c.

References font_names_size, g_free(), g_realloc(), gchar, logfont_to_xlfd(), num_fonts, pattern_match(), size, and xfontnames.

Referenced by EnumFontFamExProc().

static gchar* logfont_to_xlfd ( const LOGFONT *  lfp,
int  size,
int  res,
int  avg_width 
) [static]

Definition at line 139 of file gdkfont-win32.c.

References charset_name(), g_filename_to_utf8(), g_free(), g_strdup_printf(), gchar, gdk_DC, int, NULL, p, sprintf(), and x03.

Referenced by gdk_font_full_name_get(), and InnerEnumFontFamExProc().

static gboolean pattern_match ( const gchar pattern,
const gchar string 
) [static]

Definition at line 308 of file gdkfont-win32.c.

References c, c1, FALSE, gchar, n, p, and TRUE.

Referenced by InnerEnumFontFamExProc().

static void print_unicode_subranges ( FONTSIGNATURE *  fsp  )  [static]

Definition at line 626 of file gdkfont-win32.c.

References FALSE, g_print(), i, name, TRUE, and utab.

Referenced by gdk_font_load_internal().

static int unicode_classify ( wchar_t  wc  )  [static]

Definition at line 1583 of file gdkfont-win32.c.

References high, low, max, min, and utab.

Referenced by gdk_wchar_text_handle().


Variable Documentation

unicode_subset bit

Definition at line 519 of file gdkfont-win32.c.

Referenced by check_unicode_subranges(), TASImage::GetMask(), TGeoVoxelFinder::GetValidExtra(), TASImage::Image2Drawable(), TGGCPool::MatchGC(), TGeoVoxelFinder::Print(), TGGC::SavePrimitive(), TBits::SetBitNumber(), TGeoVoxelFinder::SortAll(), TBits::TestBitNumber(), and TGGC::UpdateValues().

GHashTable* font_name_hash = NULL [static]

Definition at line 35 of file gdkfont-win32.c.

Referenced by gdk_font_hash_insert(), gdk_font_hash_lookup(), and gdk_font_hash_remove().

gint font_names_size [static]

Definition at line 136 of file gdkfont-win32.c.

Referenced by gdk_font_list_new(), and InnerEnumFontFamExProc().

GHashTable* fontset_name_hash = NULL [static]

Definition at line 36 of file gdkfont-win32.c.

Referenced by gdk_font_hash_insert(), gdk_font_hash_lookup(), and gdk_font_hash_remove().

float gfont_angle = 0.0 [static]

Definition at line 38 of file gdkfont-win32.c.

Referenced by gdk_font_load_internal().

wchar_t high

Definition at line 518 of file gdkfont-win32.c.

Referenced by PiecewiseInterpolation::analyticalIntegralWN(), NdbMTReactionXS::BinSearch(), ClassImp(), TEveTextGL::DirectDraw(), PiecewiseInterpolation::evaluate(), TGLBoundingBox::ExpandAligned(), TMultiDimFit::Fit(), TRolke::GetLowerLimit(), TUUID::GetTime(), TRolke::GetUpperLimit(), TRolke::Interval(), RooStats::PointSetInterval::LowerLimit(), TMatrixDEigen::MakeHessenBerg(), TMatrixDEigen::MakeSchurr(), TGLBoundingBox::MergeAligned(), TRolke::ProfLikeMod1(), TDCacheFile::ReadBuffers(), rsa_num_sput(), TGLBoundingBox::SetAligned(), EntryTestDlg::SetLimits(), MethodInfo::SetResultHists(), sort(), TDSet::SplitEntryList(), TMVA::SVWorkingSet::TakeStepReg(), unicode_classify(), and RooStats::PointSetInterval::UpperLimit().

wchar_t low

Definition at line 518 of file gdkfont-win32.c.

Referenced by PiecewiseInterpolation::analyticalIntegralWN(), NdbMTReactionXS::BinSearch(), TEveCalo2D::BuildCellIdCache(), ClassImp(), TEfficiency::Combine(), TEveTextGL::DirectDraw(), TGraphAsymmErrors::Divide(), TGLTH3Slice::DrawSlice(), TGraph::Eval(), PiecewiseInterpolation::evaluate(), TFitterMinuit::ExecuteCommand(), TBackCompFitter::ExecuteCommand(), TPad::ExecuteEventAxis(), TGLBoundingBox::ExpandAligned(), TMultiDimFit::Fit(), TAxis::GetBinCenterLog(), TRolke::GetLowerLimit(), ROOT::Minuit2::Minuit2Minimizer::GetMinosError(), TRolke::GetUpperLimit(), inflate_table(), TGLLegoPainter::InitGeometryCartesian(), TRolke::Interval(), RooStats::PointSetInterval::LowerLimit(), makeData(), TMatrixDEigen::MakeHessenBerg(), TMatrixDEigen::MakeSchurr(), TGLBoundingBox::MergeAligned(), ROOT::Math::MinimTransformFunction::MinimTransformFunction(), TRolke::ProfLikeMod1(), TDCacheFile::ReadBuffers(), rsa_num_sput(), TGLBoundingBox::SetAligned(), EntryTestDlg::SetLimits(), MethodInfo::SetResultHists(), TDSet::SplitEntryList(), Rgl::Pad::PolygonStippleSet::SwapBits(), TMVA::SVWorkingSet::TakeStepReg(), unicode_classify(), and RooStats::PointSetInterval::UpperLimit().

gchar* name

Definition at line 520 of file gdkfont-win32.c.

gint num_fonts [static]

Definition at line 135 of file gdkfont-win32.c.

Referenced by gdk_font_list_new(), and InnerEnumFontFamExProc().

struct { ... } utab[] [static]

Referenced by TString::Hash(), print_unicode_subranges(), and unicode_classify().

gchar** xfontnames [static]

Definition at line 137 of file gdkfont-win32.c.

Referenced by gdk_font_list_new(), and InnerEnumFontFamExProc().


Generated on Tue Jul 5 15:58:42 2011 for ROOT_528-00b_version by  doxygen 1.5.1