note heads, for uniform widths in shape note output.
* scripts/lilypond-book.py (output): add links to filenames.
* scripts/lilypond-book.py (get_option_parser): init output_name
to ''. Backportme.
2006-03-28 Han-Wen Nienhuys <hanwen@lilypond.org>
+ * mf/feta-bolletjes.mf (overdone_heads): add small style (ugly)
+ note heads, for uniform widths in shape note output.
+
+ * scripts/lilypond-book.py (output): add links to filenames.
+
* Documentation/topdocs/INSTALL.texi (Top): update versions.
* lily/note-collision.cc (get_clash_groups): only consider when
}
#include "std-vector.hh"
+
vector<string>
string_split (string str, char c)
{
Real scale_;
Real output_scale_;
SCM physical_font_tab_;
- Direction text_direction_;
+ Direction text_direction_;
+
+ map<string, Index_to_charcode_map > charcode_maps_;
+
+ Index_to_charcode_map const *get_index_to_charcode_map (string postscript_name, FT_Face face);
public:
SCM physical_font_tab () const;
Pango_font (PangoFT2FontMap *,
return tab;
}
-Index_to_charcode_map
-make_index_to_charcode_map (FT_Face face)
-{
- Index_to_charcode_map m;
- FT_ULong charcode;
- FT_UInt gindex;
-
- for (charcode = FT_Get_First_Char (face, &gindex); gindex != 0;
- charcode = FT_Get_Next_Char (face, charcode, &gindex))
- m[gindex] = charcode;
- return m;
-}
Open_type_font::~Open_type_font ()
{
scm_gc_mark (physical_font_tab_);
}
+
+Index_to_charcode_map const *
+Pango_font::get_index_to_charcode_map (string key, FT_Face face)
+{
+ if (charcode_maps_.find (key) == charcode_maps_.end ())
+ charcode_maps_[key] = make_index_to_charcode_map (face);
+
+ if (charcode_maps_.find (key) == charcode_maps_.end ())
+ return 0;
+
+ return &charcode_maps_[key];
+}
+
Stencil
Pango_font::pango_item_string_stencil (PangoItem const *item, string str) const
{
PANGO_ASCENT (ink_rect)));
b.scale (scale_);
+ char const *ps_name_str0 = FT_Get_Postscript_Name (ftface);
+ FcPattern *fcpat = fcfont->font_pattern;
+ char *file_name_as_ptr = 0;
+ FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name_as_ptr);
+ string file_name;
+ if (file_name_as_ptr)
+ {
+ /* Normalize file name. */
+ file_name = File_name (file_name_as_ptr).to_string ();
+ }
+
SCM glyph_exprs = SCM_EOL;
SCM *tail = &glyph_exprs;
-
+
+ Index_to_charcode_map const *cmap = 0;
+ if (! (ftface->face_flags & FT_FACE_FLAG_GLYPH_NAMES))
+ cmap = ((Pango_font*)this)->get_index_to_charcode_map (file_name, ftface);
+
bool cid_keyed = false;
for (int i = 0; i < pgs->num_glyphs; i++)
{
FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
SCM char_id;
+ if (glyph_name[0] == '\0' && cmap)
+ {
+ FT_ULong char_code = cmap->find (pg)->second;
+
+ sprintf (glyph_name, "uni%04lX", char_code);
+ }
+
if (glyph_name[0] == '\0')
{
/*
Real size = pango_font_description_get_size (descr)
/ (Real (PANGO_SCALE));
- FcPattern *fcpat = fcfont->font_pattern;
- char *file_name_as_ptr = 0;
- FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name_as_ptr);
-
- string file_name;
- if (file_name_as_ptr)
- {
- /* Normalize file name. */
- file_name = File_name (file_name_as_ptr).to_string ();
- }
-
- char const *ps_name_str0 = FT_Get_Postscript_Name (ftface);
if (!ps_name_str0)
warning (_f ("no PostScript font name for font `%s'", file_name));
#include "warn.hh"
#include "lily-guile.hh"
#include "main.hh"
+#include "open-type-font.hh"
+
+
+Index_to_charcode_map
+make_index_to_charcode_map (FT_Face face)
+{
+ Index_to_charcode_map m;
+ FT_ULong charcode;
+ FT_UInt gindex;
+
+ FT_Select_Charmap(face, FT_ENCODING_UNICODE);
+ for (charcode = FT_Get_First_Char (face, &gindex); gindex != 0;
+ charcode = FT_Get_Next_Char (face, charcode, &gindex))
+ m[gindex] = charcode;
+ return m;
+}
/*
Based on ttfps by Juliusz Chroboczek
lily_cookie_fprintf (out, "/CharStrings %d dict dup begin\n", mp->numGlyphs);
+ Index_to_charcode_map ic_map (make_index_to_charcode_map (face));
+
+ for (int i = 0; i < mp->numGlyphs; i++)
+ {
+ glyph_name[0] = 0;
+ if (face->face_flags & FT_FACE_FLAG_GLYPH_NAMES)
+ {
+ FT_Error error = FT_Get_Glyph_Name (face, i, glyph_name,
+ GLYPH_NAME_LEN);
+ if (error)
+ programming_error ("print_trailer(): FT_Get_Glyph_Name() returned error");
+ else
+ glyph_name[0] = 0;
+ }
- if (face->face_flags & FT_FACE_FLAG_GLYPH_NAMES)
- for (int i = 0; i < mp->numGlyphs; i++)
- {
- FT_Error error = FT_Get_Glyph_Name (face, i, glyph_name,
- GLYPH_NAME_LEN);
- if (error)
- programming_error ("print_trailer(): FT_Get_Glyph_Name() returned error");
- else
- lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i);
+ if (!glyph_name[0])
+ {
+ sprintf (glyph_name, "uni%04lX", ic_map[i]);
+ }
+
+ lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i);
- if (! (i % 5))
- lily_cookie_fprintf (out, "\n");
- }
+ if (! (i % 5))
+ lily_cookie_fprintf (out, "\n");
+ }
lily_cookie_fprintf (out, "end readonly def\n");
lily_cookie_fprintf (out, "FontName currentdict end definefont pop\n");
fi;
+
+
fet_beginchar ("Half notehead", "s1");
draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17);
undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#);
draw_staff (-2, 2, 0);
fet_endchar;
-
if test > 0:
fet_beginchar ("Quart notehead", "s2");
draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31,
fet_endchar;
fi;
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%
+%% fonts for "small style"
+%%
+
+fet_beginchar ("Half notehead (quarter size)", "s1small");
+ draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31, 0.707, 0.0);
+ undraw_inside_ellipse (3.25, 33, 0.81, 2.8 stafflinethickness#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+%% copy of normal.
+fet_beginchar ("Quart notehead (quarter size)", "s2small");
+ % used to have 32. With 31, they are slightly bolder.
+ draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31, 0.707, 0);
+ black_notehead_width# := charwd;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+%% smaller.
+fet_beginchar ("Whole notehead (quarter size)", "s0small");
+ draw_outside_ellipse (1.60 - puff_up_factor / 3.0, 0, 0.707, 0);
+ undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
+ 0.68, 2 stafflinethickness#);
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%input feta-eindelijk;
%input feta-toevallig;
%input feta-puntje;
-%input feta-bolletjes;
-input feta-arrow;
+input feta-bolletjes;
+%input feta-arrow;
%input feta-schrift;
%input feta-schrift;
%input feta-banier;
@end html
''',
- PRINTFILENAME: '''@file{%(filename)s}
+ PRINTFILENAME: '''
+@html
+<a href="%(filename)s">
+@end html
+@file{%(filename)s}
+@html
+</a>
+@end html
''',
QUOTE: r'''@quotation