LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
physical_font_tab_ = scm_c_make_hash_table (11);
PangoDirection pango_dir = PANGO_DIRECTION_LTR;
context_ = pango_context_new ();
physical_font_tab_ = scm_c_make_hash_table (11);
PangoDirection pango_dir = PANGO_DIRECTION_LTR;
context_ = pango_context_new ();
// ugh. Should make this configurable.
pango_context_set_language (context_, pango_language_from_string ("en_US"));
// ugh. Should make this configurable.
pango_context_set_language (context_, pango_language_from_string ("en_US"));
- ly_string2scm (ps_name),
- scm_list_2 (ly_string2scm (filename),
- scm_from_int (face_index)));
+ ly_string2scm (ps_name),
+ scm_list_2 (ly_string2scm (filename),
+ scm_from_int (face_index)));
{
sprintf (s, "glyphIndex%lX", code);
}
void
get_unicode_name (char *s,
{
sprintf (s, "glyphIndex%lX", code);
}
void
get_unicode_name (char *s,
FT_Face ftface = pango_fc_font_lock_face (fcfont);
Box b (Interval (PANGO_LBEARING (logical_rect),
FT_Face ftface = pango_fc_font_lock_face (fcfont);
Box b (Interval (PANGO_LBEARING (logical_rect),
- PANGO_RBEARING (logical_rect)),
- Interval (-PANGO_DESCENT (ink_rect),
- PANGO_ASCENT (ink_rect)));
+ PANGO_RBEARING (logical_rect)),
+ Interval (-PANGO_DESCENT (ink_rect),
+ PANGO_ASCENT (ink_rect)));
Index_to_charcode_map const *cmap = 0;
bool has_glyph_names = ftface->face_flags & FT_FACE_FLAG_GLYPH_NAMES;
if (!has_glyph_names)
Index_to_charcode_map const *cmap = 0;
bool has_glyph_names = ftface->face_flags & FT_FACE_FLAG_GLYPH_NAMES;
if (!has_glyph_names)
- cmap = all_fonts_global->get_index_to_charcode_map (
- file_name, face_index, ftface);
+ cmap = all_fonts_global->get_index_to_charcode_map (file_name, face_index, ftface);
- Zero-width characters are valid Unicode characters,
- but glyph lookups need to be skipped.
+ Zero-width characters are valid Unicode characters,
+ but glyph lookups need to be skipped.
- {
- FT_Error errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name,
- GLYPH_NAME_LEN);
- if (errorcode)
- programming_error (
- _f ("FT_Get_Glyph_Name () error: %s",
- freetype_error_string (errorcode).c_str ()));
- }
+ {
+ FT_Error errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name,
+ GLYPH_NAME_LEN);
+ if (errorcode)
+ programming_error (_f ("FT_Get_Glyph_Name () error: %s",
+ freetype_error_string (errorcode).c_str ()));
+ }
- && cmap
- && is_ttf
- && cmap->find (pg) != cmap->end ())
- {
- FT_ULong char_code = cmap->find (pg)->second;
- get_unicode_name (glyph_name, char_code);
- }
+ && cmap
+ && is_ttf
+ && cmap->find (pg) != cmap->end ())
+ {
+ FT_ULong char_code = cmap->find (pg)->second;
+ get_unicode_name (glyph_name, char_code);
+ }
- {
- programming_error (
- _f ("Glyph has no name, but font supports glyph naming.\n"
- "Skipping glyph U+%0X, file %s",
- pg, file_name.c_str ()));
- continue;
- }
+ {
+ programming_error (_f ("Glyph has no name, but font supports glyph naming.\n"
+ "Skipping glyph U+%0X, file %s",
+ pg, file_name.c_str ()));
+ continue;
+ }
- // Access by glyph index directly.
- get_glyph_index_name (glyph_name, pg);
+ // Access by glyph index directly.
+ get_glyph_index_name (glyph_name, pg);
- scm_from_double (ggeo.x_offset * scale_),
- scm_from_double (- ggeo.y_offset * scale_),
- char_id),
- SCM_EOL);
+ scm_from_double (ggeo.x_offset * scale_),
+ scm_from_double (- ggeo.y_offset * scale_),
+ char_id),
+ SCM_EOL);
pango_glyph_string_free (pgs);
pgs = 0;
PangoFontDescription *descr = pango_font_describe (pa->font);
Real size = pango_font_description_get_size (descr)
pango_glyph_string_free (pgs);
pgs = 0;
PangoFontDescription *descr = pango_font_describe (pa->font);
Real size = pango_font_description_get_size (descr)
name = name.substr (0, idx);
ssize slash_idx = name.rfind ('/');
if (slash_idx != NPOS)
name = name.substr (0, idx);
ssize slash_idx = name.rfind ('/');
if (slash_idx != NPOS)
- {
- slash_idx ++;
- name = name.substr (slash_idx,
- name.length () - slash_idx);
- }
+ {
+ slash_idx++;
+ name = name.substr (slash_idx,
+ name.length () - slash_idx);
+ }
string initial = name.substr (0, 1);
initial = String_convert::to_upper (initial);
string initial = name.substr (0, 1);
initial = String_convert::to_upper (initial);
pango_fc_font_unlock_face (fcfont);
SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"),
pango_fc_font_unlock_face (fcfont);
SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"),
- ly_string2scm (ps_name),
- scm_from_double (size),
- scm_from_bool (cid_keyed),
- ly_quote_scm (glyph_exprs));
+ ly_string2scm (ps_name),
+ scm_from_double (size),
+ scm_from_bool (cid_keyed),
+ ly_quote_scm (glyph_exprs));
- {
- PangoGlyphItem *item = (PangoGlyphItem *) p->data;
- Stencil item_stencil = pango_item_string_stencil (item);
+ {
+ PangoGlyphItem *item = (PangoGlyphItem *) p->data;
+ Stencil item_stencil = pango_item_string_stencil (item);
- item_stencil.translate_axis (last_x, X_AXIS);
- last_x = item_stencil.extent (X_AXIS)[RIGHT];
+ item_stencil.translate_axis (last_x, X_AXIS);
+ last_x = item_stencil.extent (X_AXIS)[RIGHT];
- if (!item_stencil.extent_box ()[X_AXIS].is_empty ())
- {
- Stencil frame = Lookup::frame (item_stencil.extent_box (), 0.1, 0.1);
- Box empty;
- empty.set_empty ();
- Stencil dimless_frame (empty, frame.expr ());
- dest.add_stencil (frame);
- }
+ if (!item_stencil.extent_box ()[X_AXIS].is_empty ())
+ {
+ Stencil frame = Lookup::frame (item_stencil.extent_box (), 0.1, 0.1);
+ Box empty;
+ empty.set_empty ();
+ Stencil dimless_frame (empty, frame.expr ());
+ dest.add_stencil (frame);
+ }
- has_utf8_string should only be true when utf8_string is a
- variable that is bound to a *named* procedure, i.e. not a
- lambda expression.
+ has_utf8_string should only be true when utf8_string is a
+ variable that is bound to a *named* procedure, i.e. not a
+ lambda expression.
{
// For Pango based backends, we take a shortcut.
SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"),
{
// For Pango based backends, we take a shortcut.
SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"),
Box b (Interval (0, 0), Interval (0, 0));
b.unite (dest.extent_box ());
Box b (Interval (0, 0), Interval (0, 0));
b.unite (dest.extent_box ());