-Box
-Font_metric::text_dimension (String text) const
-{
- Interval ydims;
- Real w=0.0;
-
- for (int i = 0; i < text.length_i (); i++)
- {
-
- if (text[i]=='\\')
- {
- for (i++; (i < text.length_i ()) && isalpha(text[i]); i++)
- ;
- // ugh.
- i--; // Compensate for the increment in the outer loop!
- }
- else
- {
- Character_metric const *c = get_char ((unsigned char)text[i],false);
-
- // Ugh, use the width of 'x' for unknown characters
- if (c->dimensions()[X_AXIS].length () == 0)
- c = get_char ((unsigned char)'x',false);
-
- w += c->dimensions()[X_AXIS].length ();
- ydims.unite (c->dimensions()[Y_AXIS]);
- }
- }
- if (ydims.empty_b ())
- ydims = Interval (0,0);
+ You should have received a copy of the GNU General Public License
+ along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+*/