- From: Joćo Eiras <joao.eiras@gmail.com>
- Date: Tue, 10 Jul 2007 00:42:46 +0100
- To: "Web APIs WG" <public-webapi@w3.org>
- Cc: "Paul Libbrecht" <paul@activemath.org>
I've been giving this some though. There could be a collection, similar to navigator.plugins, which is navigator.fonts. That collection is populated by the browser with fonts which it's host environment provides. The collection could be index simultaneously by an integer, which would reveal fonts in alphabetical order, and could be indexed too by a string containing the font name (there's a case problem however). The collection itself could be somewhat extend to have extra methods, like navigator.fonts.loadFont(url) which could load a font from a remote file, similar to the proposed behaviour for css, and make the font persistent and immediately available while the page is loaded, or navigator.fonts.disableFont(fontName) to disable a particular font and the browser could use a fallback one. Each element of that collection would be an object with methods and properties which could give details about the font, like its name (with proper casing), glyph information, metrics, if the font can be bold or italic (or could have another style), and so forth. That collection would be bound to a read only array in ecmascript, on which method like join() could be used to get a quick list of all fonts. This can be immensely useful for any rte editor which runs on a browser. Paul Libbrecht <paul@activemath.org> escreveu: > > > Le 9 juil. 07 ą 21:55, Joćo Eiras a écrit : >> Is there any proposed API to get information about installed fonts >> in the client at runtime ? something like navigator.plugins or >> navigator.mimeTypes > > I would largely second that! > Even obtaining the metrics would be nice. > Moreover, knowing if an installed font does have glyph-x or glyph-y > (note: a unicode range availability is useless) should be. > > paul
Received on Monday, 9 July 2007 23:43:06 UTC