unscaled transform, just translate stencils.
2005-08-25 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/pango-font.cc (text_stencil): don't translate glyphs in
+ unscaled transform, just translate stencils.
+
* ly/performer-init.ly: init timing to #t. Fixes bar checks in
MIDI.
PangoFontDescription *pango_description_;
PangoAttrList *attribute_list_;
Real scale_;
+ Real output_scale_;
SCM physical_font_tab_;
public:
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 (PangoItem *, String) const;
virtual void derived_mark () const;
};
--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 *item, String str) const
{
const int GLYPH_NAME_LEN = 256;
char glyph_name[GLYPH_NAME_LEN];
}
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_3 (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);
}
GList *ptr = items;
Stencil dest;
- Real x = 0.0;
+
+ Real last_x = 0.0;
while (ptr)
{
PangoItem *item = (PangoItem *) ptr->data;
- Stencil item_stencil = pango_item_string_stencil (item, str, x);
-
-
- /*
- UGH. Is this correct for bidi?
- */
- x = item_stencil.extent (X_AXIS)[RIGHT];
+ Stencil item_stencil = pango_item_string_stencil (item, str);
+ item_stencil.translate_axis (last_x, X_AXIS);
+ last_x = item_stencil.extent (X_AXIS)[RIGHT];
#if 0 /* Check extents. */
if (!item_stencil.extent_box ()[X_AXIS].is_empty ())
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"
postscript-font-name
(if cid?
" /CIDFont findresource "
" findfont")
-
+
size
(apply
string-append