2008-09-18

Font listing revisited

In a previous post, I found some good reasons to embed font directory list inside a stylesheet. With such an approach, there is no centralized declaration of font list, so font listing with http://localhost:8080/~fonts.pdf becomes unavailable. That's bad news, since font listing is incredibly useful to debug documents, especially when there are broken fonts (the Web is full of them, waiting to be downloaded). With font list inside the stylesheet, font listing requires the stylesheet itself as a parameter. This breaks current URL scheme. By now it's possible to tell Novelang to use a given stylesheet through the book itself, or with a URL parameter. So it makes sense to use document URL as a parameter for the font listing. Obviously, this is a common use case. I'm thinking about something like:
/my.pdf?listfonts
/my.pdf?stylesheet=mypdf.xsl&listfonts
This is less elegant than current solution but if there are many font directories (like one per font) this helps to reduce the list length to what's really used. The /~fonts.pdf pseudo-document may stay useful, listing all the fonts under the project directory, using a deep directory scan.

No comments: