+2005-01-01 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * scm/framework-ps.scm (output-variables): separately scale the
+ page to mm
+
+ * lily/pango-font.cc (Pango_font): fix scaling.
+
+ * lily/font-metric.cc (design_size): design_size returns a
+ dimension now as well.
+
2004-12-31 Han-Wen Nienhuys <hanwen@xs4all.nl>
* mf/GNUmakefile ($(outdir)/%.otf-table): use findstring. Fixes
#include <math.h>
#include <cctype>
+#include "dimensions.hh"
#include "modified-font-metric.hh"
#include "open-type-font.hh"
#include "stencil.hh"
Real
Font_metric::design_size () const
{
- return 1.0;
+ return 1.0 * point_constant;
}
String
#include <math.h>
+#include "dimensions.hh"
#include "all-font-metrics.hh"
#include "output-def.hh"
#include "font-interface.hh"
|| field_val == val);
}
-/*
- TODO: this triggers a great number of font-loads (feta11 upto
- parmesan23). We could make a Delayed_load_font_metric for which the
- design size is specced in advance.
- */
Font_metric *
get_font_by_design_size (Output_def *layout, Real requested,
SCM font_vector,
SCM font_encoding
= scm_cdr (ly_chain_assoc (ly_symbol2scm ("font-encoding"), chain));
- return get_font_by_mag_step (layout, req, vec, scm_to_double (base_size),
+ return get_font_by_mag_step (layout, req, vec,
+ scm_to_double (base_size) * point_constant,
font_encoding, input_encoding);
}
SCM style,
SCM variant,
SCM weight,
- SCM stretch,
- Real size);
+ SCM stretch);
Font_metric *
select_pango_font (Output_def *layout, SCM chain);
-const int PANGO_DPI = 1200;
+const int PANGO_RESOLUTION = 1200;
#endif /* HAVE_PANGO16 */
#endif /* PANGO_FONT_HH */
Box b (Interval (-hb, m.width - hb),
Interval (-vb, m.height - vb));
- b.scale (design_size () * Real (point_constant) / face_->units_per_EM);
+ b.scale (design_size () / Real (face_->units_per_EM));
return b;
}
quickly. --hwn.
*/
scm_from_int (1));
- return scm_to_double (entry);
+ return scm_to_double (entry) * Real (point_constant);
}
? PANGO_DIRECTION_LTR
: PANGO_DIRECTION_RTL;
context_ =
- pango_ft2_get_context (PANGO_DPI, PANGO_DPI);
+ pango_ft2_get_context (PANGO_RESOLUTION, PANGO_RESOLUTION);
// context_ = pango_ft2_font_map_create_context (fontmap);
attribute_list_= pango_attr_list_new();
- scale_ = inch_constant / (Real (PANGO_SCALE) * Real (PANGO_DPI));
+
+ /*
+ urgh. I don't understand this. Why isn't this 1/(scale * resolution)
+
+ --hwn
+ */
+ scale_ = INCH_TO_BP / (Real (PANGO_SCALE) * Real (PANGO_RESOLUTION));
pango_context_set_language (context_, pango_language_from_string ("en_US"));
pango_context_set_base_dir (context_, pango_dir);
PangoFontDescription *descr = pango_font_describe (pa->font);
Real size = pango_font_description_get_size (descr)
- / (Real (PANGO_SCALE)) ;
+ / (Real (PANGO_SCALE));
FcPattern *fcpat = fcfont->font_pattern;
char *filename = 0;
*/
#include <math.h>
+#include "dimensions.hh"
#include "all-font-metrics.hh"
#include "output-def.hh"
#include "pango-font.hh"
{
String name_str = ly_scm2string (scm_cdr (name));
description = pango_font_description_from_string (name_str.to_str0 ());
-
-
- Real step = robust_scm2double (ly_symbol2scm ("font-size"), 0.0);
- Real size = layout->get_dimension (ly_symbol2scm ("text-font-size"))
- * pow (2.0, step / 6.0);
- pango_font_description_set_size (description,
- gint (size * PANGO_SCALE));
}
else
{
SCM weight = ly_chain_assoc_get (ly_symbol2scm ("font-series"), chain,
SCM_BOOL_F);
- Real step = robust_scm2double (ly_symbol2scm ("font-size"), 0.0);
- Real size = layout->get_dimension (ly_symbol2scm ("text-font-size"))
- * pow (2.0, step / 6.0);
-
description
= symbols_to_pango_font_description (family, style, variant, weight,
- SCM_BOOL_F,
- size);
+ SCM_BOOL_F);
}
+ Real step = robust_scm2double (ly_symbol2scm ("font-size"), 0.0);
+ Real size = layout->get_dimension (ly_symbol2scm ("text-font-size"))
+ * pow (2.0, step / 6.0) * point_constant;
+ pango_font_description_set_size (description,
+ gint (size * PANGO_SCALE));
+
Font_metric * fm = all_fonts_global->find_pango_font (description);
return find_scaled_font (layout, fm, 1.0,
SCM style,
SCM variant,
SCM weight,
- SCM stretch,
- Real size)
+ SCM stretch)
{
PangoFontDescription * description = pango_font_description_new ();
symbol_to_pango_weight (weight));
pango_font_description_set_stretch (description,
symbol_to_pango_stretch (stretch));
- pango_font_description_set_size (description,
- gint (size * PANGO_SCALE));
return description;
}
Real
Tex_font_metric::design_size () const
{
- return info_.design_size;
+ return info_.design_size * point_constant;
}
String
(value->string (ly:output-def-lookup layout ly-key)) " def \n"))
(string-append
- "/lily-output-units " (number->string mm-to-bigpoint) " def %% milimeter \n"
+ "/lily-output-units " (number->string mm-to-bigpoint) " def %% milimeter
+lily-output-units lily-output-units scale
+"
(output-entry "staff-line-thickness" 'linethickness)
(output-entry "line-width" 'linewidth)
(output-entry "paper-size" 'papersizename)
(output-entry "staff-height" 'staffheight) ;junkme.
"/output-scale "
(number->string (ly:output-def-lookup layout 'outputscale))
- " lily-output-units mul def \n"
+ " def \n"
(output-entry "page-height" 'vsize)
(output-entry "page-width" 'hsize)))