[smufl-discuss] Re: Implementation Examples

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[smufl-discuss] Re: Implementation Examples

David Webber-2
From: Odekirk, Shawn

===================
I found my problem. I had not set the text alignment to TA_BASELINE and it
defaulted to TA_TOP.

Now I’m trying to figure out how to calculate the correct font height. I’m
currently using the MM_TEXT mapping mode but I am wondering if another
mapping mode might make things easier.

I am still very interested in any advice or suggestions anyone is willing to
offer.

I really do apologize for spamming the group with questions that are not
directly related to SMuFL. I promise any future posts from me will be on
topic.
=====================

Daniel seems to have fingered me, ever so politely, for an answer :-) so
here goes.  I have no idea whether this will answer your query.  My software
uses its own fonts, though I am still thinking hard about how it can be made
to use SMuFL fonts.

One of the characters in my font is a five line staff.   This is never used
for drawing, but it is defined as being exactly the height of the Em-square
of the font, and all the other entries in the font are designed at the right
scale relative to it.   I define the point size of my music fonts to be the
height of a 5 line staff.   So the pixel resolution of the device lets me
translate from a point size to the pixel height of the staff, and the
definition of the font's em-square as the height of a staff, then lets me
load the font at the appropriate size.

I use MM_TEXT mode exclusively, and manage all drawing in terms of pixels.
I suspect any other would result in severe difficulties, - but I haven't
considered that in the 25 years since Windows 3.1 came out, so I may be
wrong.  :-)    To guarantee a crystal clear image on the screen, I only load
the fonts at sizes where the staff height is a multiple of 8 pixels.  (This
is less crucial on printers which have much higher DPI.)

For managing the properties of individual glyphs,  you may find the Windows
API functions GetGlyphOutline() and GetGlyphMetrics() to be useful.   These
can get you data which allow you to move the drawing point to the exact
pixel you want for each individual glyph, as music is not like text where
the font engine can print a string by automatically moving the drawing point
left and right by the width of a character.

Hope this helps,

Dave

David Webber
Mozart Music Software
http://www.mozart.co.uk/


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <[hidden email]>.
To unsubscribe, E-mail to: <[hidden email]>
To switch to the DIGEST mode, E-mail to <[hidden email]>
To switch to the INDEX mode, E-mail to <[hidden email]>
Send administrative queries to  <[hidden email]>