[pmwiki-users] TextFormatting: [+ big +] vs. '+ big +'

Marc Cooper gmane at auxbuss.com
Sun Jun 25 14:26:42 CDT 2006


Patrick R. Michaud said...
> On Fri, Jun 23, 2006 at 08:34:11AM +0100, Marc Cooper wrote:
> > 
> > Unrelated, but I'd like an option to be added to the [+big+], [-small-] 
> > markup to allow the scale to be changed. Currently I override it, but 
> > allowing it to be customized in the PmWIki-way would be better, imo.
> 
> Currently PmWiki scales [+...+] and [-...-] so that each larger text
> size is 1.2 times larger than the previous size.  (The value of 1.2 is
> suggested by CSS2.)
> 
> One can redefine the [+...+] and [-...-] markups to use any scaling
> factor desired (or look up scale values from a table, or any other
> desired approach).  For example, to make each larger text size
> 1.1 times larger than the previous size, use the following in
> local/config.php:
> 
>     ## [+big+], [-small-]
>     Markup('[+','inline','/\\[(([-+])+)(.*?)\\1\\]/e',
>       "'<span style=\'font-size:'.(round(pow(1.1,$2strlen('$1'))*100,0)).'%\'>'.
>         PSS('$3</span>')");
> 
> (Note that 11/10 is 1.1 -- I use the fractional value here because it ends up
> being slightly more precise in floating point than typing "1.1".)

Strangely enough, that's precisely what I did. I'm more used to 
typesetting "rules" - LaTeX does a good job even in its base classes. 
Using 1.2, the smaller sizes falls away too quickly for my liking.

The CSS1 spec suggested 1.5 - remember those wildly varying font sizes  
- whereas CSS2 suggested 1.2. However, CSS 2.1 says:

"Note: implementation experience has demonstrated that a fixed ratio 
between adjacent absolute-size keywords is problematic, and this 
specification does NOT recommend such a fixed ratio, in contrast to 
previous specifications."

(Since there have been centuries of empirical typographical experience, 
it's always struck me as bizarre that the CSS designers seemed to have 
ignored it. But I digress.)

We could, of course, use the CSS supplied: xx-small | x-small | small | 
medium | large | x-large | xx-large <removes tongue from cheek>

And that's kind of why I expressed the view that a variable would be 
better. Heck, I'd actually prefer an array of values, but that's hardly 
a top priority, as the 1.1 override and CSS are sufficient.

-- 
Best,
Marc





More information about the pmwiki-users mailing list