coolwanglu/pdf2htmlEX — pull request #81 by jahewson (2013-01-31 23:12:01+00:00)
Title: Stroked Text

I've implemented stroked text, and split the text color into two separate colors for **fill** and **stroke**. This works perfectly in WebKit via `-webkit-text-stroke` and is emulated in other browsers using `text-shadow`.

- The `text-shadow` fallback does not support `color: transparent` for fills, because the shadow occupies the entire area behind the text and so a transparent `color` results in seeing the entire shadow. I've used `color: white` as the "no-fill" fallback, so that at least when the background is white it works correctly.

- I've not used the stroke width from `GfxState`, because the `text-shadow` fallback forces both color and width to be defined at the same time, which doesn't fit well with the existing color+hash mechanism used in the "install" procedures. I've used a sensible default based on the *em* size.

Here's some [sample output](https://gist.github.com/raw/4687589/c1777f2b73bb302257c83485e5af2edcddc12dcf/stroked-text.html) and the [sample PDF](http://dl.dropbox.com/u/4305166/stroke-text.pdf), note that the yellow filled text does not appear filled in Firefox because it is not using the stroke + fill rendering mode, it is actually two pieces of text layered on top of each other.