[Webkit-unassigned] [Bug 12324] User needs to be able to set Lucida Grande "italic"

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 22 14:34:52 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=12324





--- Comment #14 from Ryosuke Niwa <rniwa at webkit.org>  2010-09-22 14:34:52 PST ---
Thanks for the info.

(In reply to comment #10)
> As to the bug itself: WebKit’s API follows AppKit in only allowing you to use real typefaces and not synthesized ones. This is similar to how if you select some text in Lucida Grande in TextEdit, then Format > Font > Italic is disabled.

Do you know where we're deciding this?  I've been looking through WebCore / WebKit but I can't find the place where we update the menu item status.

>Arguably, since WebKit is able to synthesize typefaces and the user may encounter them in content, we should relax this (note that it’s already possible to produce synthetic italics in editable HTML in Safari by hitting Command-I). Alternatively, there may already be a way for an application to send the corresponding selector to the WebView and get the same behavior that you get in Safari.

I have to read the code to understand to respond to this.

(In reply to comment #13)
> I did some simple tests in the browser with document.queryCommandEnabled("Italic") and confirmed that the document seems to return true even when text of a font such as Lucida Grande is selected.

Yeah, so it seems like we have a different code path to detect whether or not the text can be italicized.

> I think I ran into similar problems to this when I was developing MarsEdit's rich editor. As I recall I worked around it by moving away from the changeFontTrait: as the menu item action for these style items. By bypassing the font manager and going straight to WebKit, I believe I was able to use a combination of queryCommandEnabled to validate and execCommand to perform the toggle.

I looked at changeFontTrait and - (void)_addToStyle:(DOMCSSStyleDeclaration *)style fontA:(NSFont *)a fontB:(NSFont *)b seems to be the key functions here.  But I don't hink bypassing them will fix the menu item being grayed out.  We probably have a separate code path to mimic AppKit's behavior but I think the default fall back should be queryCommandEnabled or execCommand, or at least they should share some code.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list