[webkit-help] Changing font size of selected text
emerick at gmail.com
Wed May 5 08:27:36 PDT 2010
I'm using Chromium on Windows, but this is just a general
WebKit/WebCore question. I'm writing an application that uses WebKit
to perform rich text editing. I'd like to change the font size for my
current selection, so I end up indirectly calling EditorCommand.cpp's
executeFontSize function. Testing reveals that this function accepts
only logical font sizes from 0 - 9, which map to CSS-ish font sizes.
That's OK, but it seems that executeFontDelta can get me to _any_
particular font size, as long as I specify it as a delta of the
current font. For instance, if the selection is font size 14, I can
call executeFontDelta with a parameter of "6" to increase my font by 6
points to 20. Neither of these methods are ideal for my purposes.
I'm curious if I'm just going about this the wrong way. Ideally, I'd
just like to call something that will set my font size to whatever I
specify (assuming it's valid, of course). Does anyone have any
experience with this?
More information about the webkit-help