|
From: | Auto mailings of changes to Lily Issues via Testlilyissues-auto |
Subject: | [Lilypond-auto] [LilyIssues-auto] [testlilyissues:issues] Re: #5324 \abs-fontsize and set-global-staff-size in books |
Date: | Thu, 16 Aug 2018 10:39:34 -0000 |
Hi David,
Here are my findings: Font handling is robust and does not depend on \cm, \mm, \pt etc.
Font handling (metrics, skylines, ...) is based on the global staff size and does not suffer from various layout staff sizes. \cm is only needed when specifying distances such as margins or line widths: it's for converting the current layout staff spaces into specific units.
Units and fonts
When it comes to fonts, \fontsize just will apply a factor (w/o any dimension involved) to the current font size.
\abs-fontsize, however, takes an argument that is supposed to be in pt (as absolute output size independent of any scaling). Internally, this is done by using good old \fontsize with an appropriate correction factor.
Base output unit of measure is mm
As LilyPond is an European (Dutch) program, is consequently uses millimetres (mm) as final output unit of measure. In the end, everything has to be converted in mm.
1 mm = 1, an American printer's point is 1/72.27 of an inch, and 1 inch = 25.4 mm.
The strange hashtable key font-size lilypond_serif_italic_3.8662109375
for an 11-pt-font, is nothing but 11 pt converted into millimetres: 11 pt = 3.866... mm
Typesetting unit of measue is staff-space -> output_scale
Typesetting is generally done in staff-spaces. That's where the standard output_scale = 1.757299
comes from: for a standard 20-pt global staff-size, a staff-space is 5 pt (the inter-line distance in a 5-line staff) and again, 1.757299 nothing but the fourth of staff-size in millimetres.
LilyPond font metrics scaling factor
The LilyPond font scaling factor scale_
stored in the hashtable will be calculated from nothing but the output_scale
requested and a few Pango constants. Dividing by output_scale
will convert a distance in millimetres into global staff-spaces.
The issue 677 ff. scaling problem with markup scores within scores still hasn't been completely solved, but the fonts always have the correct size.
When combining differing global-staff-size and layout-staff-sizes, the markup score will have an incorrect layout-staff-space. But this is a different issue, because the fonts are OK.
I've attached an extreme example where we expect a 40 pt outer score and a 20 pt inner markup score, and the inner markup score staff-space (in blue) is four times too small.
\version "2.19.82" #(set-global-staff-size 10) \score { \relative { a'1^\markup \italic "Abc testing" ^\markup \with-color #blue { \score { \new Staff \relative { a'1_\markup \italic "Abc testing" | } \layout { ragged-right = ##f indent = 0.0 line-width = 100.0\mm #(layout-set-staff-size 20) } } } } \layout { ragged-right = ##f indent = 0.0 line-width = 100.0\mm #(layout-set-staff-size 40) } }
All the best,
Torsten
Attachments:
[issues:#5324] \abs-fontsize and set-global-staff-size in books
Status: Started
Created: Sat May 19, 2018 06:22 PM UTC by Torsten Hämmerle
Last Updated: Thu Aug 16, 2018 09:07 AM UTC
Owner: Torsten Hämmerle
Attachments:
Issue 5324: \abs-fontsize and set-global-staff-size in books
The font buffering hashtable will provide an outdated LilyPond
scale factor after changing global staff size between books. Mainly
\abs-fontsize concerned, because \fontsize will usually not match
a Pango font-size used in a differently scaled book and fresh fonts
will have to be loaded anyway.
The straight-forward solution is to simply apply #ly:restet-all-fonts
from within #set-global-staff-size.
http://codereview.appspot.com/341450043
When creating several \books of different staff-sizes set by #(set-global-staff-size ...), markup in absolute font sizes (\abs-fontsize) will mess up spacing (font-metrics) in the subsecquent books.
(reported by David Sumbler: http://lilypond.1069038.n5.nabble.com/Maintaining-font-size-regardless-of-staff-size-td213007.html)
#(ly:set-option 'debug-skylines #t) \header { title = \markup \concat { \abs-fontsize #21 "X let’s see how long X" \with-color #red \abs-fontsize #21 "XX" } } #(set-global-staff-size 18) \book { { b'1^\markup \abs-fontsize #14 "Test" } } #(set-global-staff-size 26) \book { { b'1^\markup \abs-fontsize #14 "Test" } } #(set-global-staff-size 10) \book { { b'1^\markup \abs-fontsize #14 "Test" } }
Sent from sourceforge.net because address@hidden is subscribed to https://sourceforge.net/p/testlilyissues/issues/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/testlilyissues/admin/issues/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Testlilyissues-auto mailing list address@hidden https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto
[Prev in Thread] | Current Thread | [Next in Thread] |