turns on TTF kerning.
* scm/output-ps.scm (glyph-string): backport: use width in glyph-string
+2005-11-30 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/pango-font.cc: backport: pango-font.cc, completely. This
+ turns on TTF kerning.
+
+ * scm/output-ps.scm (glyph-string): backport: use width in glyph-string
+
2005-11-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * GNUmakefile.in: backport of out-www excision.
+
* scripts/*.py: update bug reporting addresses.
* lily/main.cc (LY_DEFINE): gmane address for reporting bugs.
<td class="left-column">
<ul>
<li>
- <a class="title" href="../user/out-www/lilypond/Tutorial.html">Tutorial</a>
+ <a class="title" href="user/lilypond/Tutorial.html">Tutorial</a>
<br>(start here)
</ul>
</td>
<ul>
<li>
- <a class="title" href="../topdocs/out-www/NEWS.html">NEWS</a>
+ <a class="title" href="topdocs/NEWS.html">NEWS</a>
<br>(changes since the last major release)
<li>
- <a class="title" href="../topdocs/out-www/INSTALL.html">INSTALL</a>
+ <a class="title" href="topdocs/INSTALL.html">INSTALL</a>
<br>(how to compile)
</ul>
</td>
<ul>
<li>
-<a class="title" href="../user/out-www/lilypond/index.html">User manual</a>
-(in <a class="title" href="../user/out-www/lilypond.pdf">PDF</a>, in
-<a class="title" href="../user/out-www/lilypond.html">one big page, ~4Mb</a>)
+<a class="title" href="user/lilypond/index.html">User manual</a>
+(in <a class="title" href="user/lilypond.pdf">PDF</a>, in
+<a class="title" href="user/lilypond.html">one big page, ~4Mb</a>)
<br>(everything about LilyPond)
-<li><a class="title"href="../../examples.html">Examples</a>
+<li><a class="title"href="../examples.html">Examples</a>
<br>(see some examples)
-<li><a class="title" href="../../input/test/out-www/collated-files.html">Tips and tricks</a>
-(in <a class="title" href="../../input/test/out-www/collated-files.pdf">PDF</a>)
+<li><a class="title" href="../input/test/collated-files.html">Tips and tricks</a>
+(in <a class="title" href="../input/test/collated-files.pdf">PDF</a>)
<br>(for advanced users)
- <li><a class="title" href="../user/out-www/music-glossary/index.html">Glossary</a>
-(in <a class="title" href="../user/out-www/music-glossary.pdf">PDF</a>, in
-<a class="title" href="../user/out-www/music-glossary.html">one big page</a>)
+ <li><a class="title" href="user/music-glossary/index.html">Glossary</a>
+(in <a class="title" href="user/music-glossary.pdf">PDF</a>, in
+<a class="title" href="user/music-glossary.html">one big page</a>)
<br>(for non-English users)
</ul>
<ul>
<li>
- <a class="title" href="../user/out-www/lilypond-internals/index.html">Program reference</a>
- (in <a class="title" href="../user/out-www/lilypond-internals.html">one big page</a>)
+ <a class="title" href="user/lilypond-internals/index.html">Program reference</a>
+ (in <a class="title" href="user/lilypond-internals.html">one big page</a>)
<br>(definitions for tweaking)
<li>
- <a class="title" href="../../input/regression/out-www/collated-files.html">Regression tests</a> (in <a class="title" href="../../input/regression/out-www/collated-files.pdf">PDF</a>) ~ 2.4Mb
+ <a class="title" href="../input/regression/collated-files.html">Regression tests</a> (in <a class="title" href="../input/regression/collated-files.pdf">PDF</a>) ~ 2.4Mb
<br>(for developers)
- <li><a class="title" href="../bibliography/out-www/index.html">Bibliography</a>
+ <li><a class="title" href="bibliography/index.html">Bibliography</a>
<br>(background information)
<li><a class="title" href="THANKS.html">Thank yous</a>
$(MAKE) -C Documentation
install-WWW:
- -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
- tar -C $(webdir)/ -xzf $(outdir)/web.tar.gz
-# install-WWW does not recurse; fake it visiting Documentation/user manually
+ -$(INSTALL) -m 755 -d $(DESTDIR)$(webdir)
+ cp -a $(outdir)/web-root/ $(DESTDIR)$(webdir)/
+
$(MAKE) -C Documentation/user local-install-WWW
$(MAKE) -C Documentation/user install-info
footify = $(PYTHON) $(step-bindir)/add-html-footer.py --name $(PACKAGE_NAME) --version $(TOPLEVEL_VERSION)
footifymail = MAILADDRESS=bug-lilypond@gnu.org
+
local-WWW-post:
# need UTF8 setting in case this is hosted on a website.
- echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(builddir)/.htaccess
- $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(builddir)/examples.html ./
- cd $(builddir) && $(FIND) . -name '*.html' -print | $(footifymail) xargs $(footify)
- cd $(builddir) && find . -name \*.html~ -print | xargs rm -f
+ echo -e 'AddDefaultCharset utf-8\nAddCharset utf-8 .html\nAddCharset utf-8 .en\nAddCharset utf-8 .nl\nAddCharset utf-8 .txt\n' > $(outdir)/.htaccess
+ $(PYTHON) $(buildscript-dir)/mutopia-index.py -o $(outdir)/examples.html ./
+ echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/index.html">' > $(outdir)/index.html
+ echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(outdir)/index.html
+
+ $(FIND) $(builddir) -name '*.html' -print | $(footifymail) xargs $(footify)
+ $(FIND) $(builddir) -name \*.html~ -print | xargs rm -f
cd $(builddir) && find Documentation input \
$(web-ext:%=-path '*/out-www/*.%' -or) -type l \
> $(outdir)/weblist
- echo '<META HTTP-EQUIV="refresh" content="0;URL=Documentation/out-www/index.html">' > $(builddir)/index.html
- echo '<html><body>Redirecting to the documentation index...</body></html>' >> $(builddir)/index.html
- cd $(builddir) && ls *.html >> $(outdir)/weblist
- cat $(outdir)/weblist | (cd $(builddir); GZIP=-9v tar -czf $(outdir)/web.tar.gz -T -)
+ ls $(outdir)/*.html >> $(outdir)/weblist
+
+## rewrite paths so we lose out-www
+ rm -rf $(outdir)/web-root/
+ mkdir $(outdir)/web-root/
+ cat $(outdir)/weblist | (cd $(builddir); tar -cf- -T- ) | \
+ tar -C $(outdir)/web-root/ -xf -
+ cd $(outdir)/web-root/ && \
+ for a in `find -name out-www`; do \
+ mv $$a/* $$a/.. ; \
+ rmdir $$a ; \
+ done
share-prefix = $(builddir)/share
tree-prefix = $(builddir)/share/lilypond/$(TOPLEVEL_VERSION)
return lst
+junk_prefix = 'out-www/'
headertext= r"""
<p>You're looking at a page with some LilyPond samples. These files
are also included in the distribution. The output is completely
-generated from the <tt>.ly</tt> source file, without any further touch
-up.
+generated from the source file, without any further touch up.
<p>
The pictures are 90 dpi anti-aliased snapshots of the printed output.
-If you want a better impression of the appearance, do print out one of
-the PDF or PostScript files; they use scalable fonts, and should look
-good at any resolution.
-
+For a good impression of the quality print out the PDF file.
"""
headertext_nopics= r"""
def list_item (file_name, desc, type, lst = list):
if os.path.isfile (file_name):
lst.write ('<li><a href="%s">%s</a>'
- % (file_name, desc))
+ % (re.sub (junk_prefix, '', file_name), desc))
# FIXME: include warning if it uses \include
# files.
progress_indication ("[" + String (pango_fn));
Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
- RIGHT,
description,
output_scale);
val = pf->self_scm ();
PangoFontDescription *pango_description_;
PangoAttrList *attribute_list_;
Real scale_;
+ Real output_scale_;
SCM physical_font_tab_;
public:
SCM physical_font_tab () const;
Pango_font (PangoFT2FontMap *,
- Direction leftright,
PangoFontDescription *,
Real);
~Pango_font ();
SCM font_file_name () const;
void register_font_file (String, String);
Stencil text_stencil (String) const;
- Stencil pango_item_string_stencil (PangoItem *, String, Real) const;
+ Stencil pango_item_string_stencil (const PangoItem *, String) const;
virtual void derived_mark () const;
};
#include "stencil.hh"
Pango_font::Pango_font (PangoFT2FontMap *fontmap,
- Direction dir,
PangoFontDescription *description,
Real output_scale)
{
(void) fontmap;
physical_font_tab_ = scm_c_make_hash_table (11);
- PangoDirection pango_dir = (dir == RIGHT)
- ? PANGO_DIRECTION_LTR
- : PANGO_DIRECTION_RTL;
+ PangoDirection pango_dir = PANGO_DIRECTION_LTR;
context_
= pango_ft2_get_context (PANGO_RESOLUTION, PANGO_RESOLUTION);
// context_ = pango_ft2_font_map_create_context (fontmap);
--hwn
*/
+ output_scale_ = output_scale;
scale_ = INCH_TO_BP / (Real (PANGO_SCALE) * Real (PANGO_RESOLUTION) * output_scale);
/*
}
Stencil
-Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) const
+Pango_font::pango_item_string_stencil (PangoItem const *item, String str) const
{
const int GLYPH_NAME_LEN = 256;
char glyph_name[GLYPH_NAME_LEN];
- PangoAnalysis *pa = &(item->analysis);
+ PangoAnalysis const *pa = &(item->analysis);
PangoGlyphString *pgs = pango_glyph_string_new ();
pango_shape (str.to_str0 () + item->offset,
- item->length, pa, pgs);
+ item->length, (PangoAnalysis*) pa, pgs);
PangoRectangle logical_rect;
PangoRectangle ink_rect;
PANGO_ASCENT (ink_rect)));
b.scale (scale_);
-
+
SCM glyph_exprs = SCM_EOL;
SCM *tail = &glyph_exprs;
FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN);
-
- SCM char_id;
+ SCM char_id;
if (glyph_name[0] == '\0')
{
/*
CID entry
- */
+ */
cid_keyed = true;
char_id = scm_from_int (pg);
}
else
char_id = scm_makfrom0str (glyph_name);
- *tail = scm_cons (scm_list_3 (scm_from_double (ggeo.x_offset * scale_
- + dx),
+
+ *tail = scm_cons (scm_list_4 (scm_from_double (ggeo.width * scale_),
+ scm_from_double (ggeo.x_offset * scale_),
scm_from_double (ggeo.y_offset * scale_),
+
char_id),
SCM_EOL);
- dx = 0.0;
tail = SCM_CDRLOC (*tail);
}
/ (Real (PANGO_SCALE));
FcPattern *fcpat = fcfont->font_pattern;
- char *file_name = 0;
- FcPatternGetString (fcpat, FC_FILE, 0, (FcChar8 **) & file_name);
-#ifdef __MINGW32__
- /* Normalize file name. */
- // FIXME: memleak(s?), drop the #ifdef?
- file_name = File_name (file_name).to_string ().get_copy_str0 ();
-#endif
+ 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)
String ps_name;
if (!ps_name_str0
- && file_name
- && (String (file_name).index (".otf") >= 0
- || String (file_name).index (".cff") >= 0))
+ && file_name != ""
+ && (file_name.index (".otf") >= 0
+ || file_name.index (".cff") >= 0))
{
/* UGH: kludge a PS name for OTF/CFF fonts. */
String name = file_name;
- int idx = max (String (file_name).index (".otf"),
- String (file_name).index (".cff"));
+ int idx = max (file_name.index (".otf"),
+ file_name.index (".cff"));
name = name.left_string (idx);
{
((Pango_font *) this)->register_font_file (file_name, ps_name);
pango_fc_font_unlock_face (fcfont);
-
+
SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"),
scm_makfrom0str (ps_name.to_str0 ()),
scm_from_double (size),
Stencil
Pango_font::text_stencil (String str) const
{
- GList *items = pango_itemize (context_,
- str.to_str0 (),
- 0, str.length (), attribute_list_,
- NULL);
+ GList *items
+ = pango_itemize (context_,
+ str.to_str0 (),
+ 0, str.length (), attribute_list_,
+ NULL);
- GList *ptr = items;
Stencil dest;
- Real x = 0.0;
- while (ptr)
+
+ Real last_x = 0.0;
+
+ Direction text_dir = RIGHT;
+ for (GList *p = items; p; p = p->next)
+ {
+ PangoItem *item = (PangoItem *) p->data;
+ if (item->analysis.level == PANGO_DIRECTION_RTL)
+ text_dir = LEFT;
+ }
+
+ for (GList *ptr = items; ptr; ptr = ptr->next)
{
PangoItem *item = (PangoItem *) ptr->data;
- Stencil item_stencil = pango_item_string_stencil (item, str, x);
+ Stencil item_stencil = pango_item_string_stencil (item, str);
- x = item_stencil.extent (X_AXIS)[RIGHT];
+ if (text_dir == RIGHT)
+ {
+ item_stencil.translate_axis (last_x, X_AXIS);
+ last_x = item_stencil.extent (X_AXIS)[RIGHT];
+ }
+ else if (text_dir == LEFT)
+ {
+ dest.translate_axis (item_stencil.extent (X_AXIS)[RIGHT], X_AXIS);
+ }
+#if 0 /* Check extents. */
+ 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);
+ }
+#endif
+
dest.add_stencil (item_stencil);
-
- ptr = ptr->next;
}
/*
*/
char *descr_string = pango_font_description_to_string (pango_description_);
SCM exp
- = scm_list_3 (ly_symbol2scm ("utf8-string"),
+ = scm_list_3 (ly_symbol2scm ("utf-8-string"),
scm_makfrom0str (descr_string),
scm_makfrom0str (str.to_str0 ()));
return Stencil (b, exp);
}
-#if 0
- // check extents.
- if (!dest.extent_box ()[X_AXIS].is_empty ())
- {
- Stencil frame = Lookup::frame (dest.extent_box (), 0.1, 0.1);
- Box empty;
- empty.set_empty ();
- Stencil dimless_frame (empty, frame.expr ());
- dest.add_stencil (frame);
- }
-#endif
return dest;
}
%{_datadir}/lilypond/@TOPLEVEL_VERSION@/
%{_datadir}/locale/*/LC_MESSAGES/lilypond.mo
-
-# %{_libdir}/lilypond/
+%{_libdir}/lilypond/
%files documentation
(define (glyph-string
postscript-font-name
size cid?
- x-y-named-glyphs)
-
- (define (encoding-vector-hack glyphs)
-
- ;; GS fucks up with glyphs that are not in the
- ;; encoding vector.
- (define (inner j glyphs)
- (if (or (null? glyphs) (> j 256))
- '()
- (cons (format "dup ~a /~a put\n"
- j (car glyphs))
- (inner (1+ j) (cdr glyphs)))))
-
- (format "256 array 0 1 255 { 1 index exch /.notdef put} for\n ~a
-/EncHack reencode-font /EncHack findfont"
- (apply string-append (inner 32 glyphs))))
- ;; END HACK.
-
- (format #f "gsave 1 output-scale div 1 output-scale div scale
- /~a ~a ~a scalefont setfont\n~a grestore"
+ w-x-y-named-glyphs)
+
+ (format #f "gsave
+ /~a ~a ~a output-scale div scalefont setfont\n~a grestore"
postscript-font-name
(if cid?
" /CIDFont findresource "
" findfont")
-
size
(apply
string-append
(map (lambda (item)
(let*
- ((x (car item))
- (y (cadr item))
- (g (caddr item))
+ ((w (car item))
+ (x (cadr item))
+ (y (caddr item))
+ (g (cadddr item))
(prefix (if (string? g) "/" "")))
- (if (and (= 0.0 x)
- (= 0.0 y))
- (format #f " ~a~a glyphshow\n" prefix g)
- (format #f " ~a ~a rmoveto ~a~a glyphshow\n"
- x y
- prefix
- g))))
- x-y-named-glyphs))))
+ (format #f " gsave ~a~a glyphshow grestore ~a ~a rmoveto \n" prefix g (+ w x) y)
+ ))
+ w-x-y-named-glyphs))))
(define (grob-cause offset grob)
(let* ((cause (ly:grob-property grob 'cause))