- From: Antoine Quint <ml@graougraou.com>
- Date: Tue, 23 Mar 2004 16:10:01 +0100
- To: ndumas@insa-rouen.fr
- Cc: <www-svg@w3.org>
Bonjour Nathalie, On 23 mars 04, at 16:16, ndumas@insa-rouen.fr wrote: > i'm actually having a hard time finding information about how to > measure a > string (or a sentence) once a font has been applied. > > that is, what is the length of a sentence (in px or so) once it is > written > in a certain font of a certain weigth ? This is quite simple. There are two mehtods you can call on your <text> element: - getComputedTextLength(): takes into account internationalization issues (vertical text for instance) - getBBox(): just gives you the raw bbox Antoine -- Antoine Quint <aq@fuchsia-design.com> W3C SVG Working Group Invited Expert SVG Consulting, Teaching and Outsourcing
Received on Tuesday, 23 March 2004 10:11:17 UTC