POV-Ray : Newsgroups : povray.programming : The math of circular truetype fonts : Re: Font metrics function Server Time
28 Jul 2024 22:24:54 EDT (-0400)
  Re: Font metrics function  
From: Mark Wagner
Date: 27 Feb 2000 00:33:11
Message: <38b8b717@news.povray.org>
Lummox JR wrote in message <38B### [at] aolcom>...
>And the function numbers:
>
>  1 - min_extent of string <argument>, spacing included
>  2 - max_extent of string <argument>, (horizontal) spacing included
>  3 - horizontal kerning between the two characters in string
>      <argument>, or 0 if the string is invalid
>  4 - maximum ascent of the font
>  5 - maximum descent of the font
>  6 - maximum character width (spacing included)
>
>Functions 4-6 will of course ignore the argument, so "" can be used.
>Naturally this idea is in its infancy, so any suggestions that could
>improve it would be most welcome.


Improvement #1: Replace function numbers with keywords.  This is easy enough
to code, and will simplify using the function.  For example:

         Fontmetrics("arial.ttf", min_extent, "Hello, world!")

is easier to remember and understand than

         Fontmetrics("arial.ttf", 1, "Hello, world!")


Mark


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.