WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
46408
Add C API to WebKit2 for changing the font families
https://bugs.webkit.org/show_bug.cgi?id=46408
Summary
Add C API to WebKit2 for changing the font families
Kenneth Rohde Christiansen
Reported
2010-09-23 14:40:19 PDT
Created
attachment 68595
[details]
Patch Patch coming...
Attachments
Patch
(11.58 KB, patch)
2010-09-23 14:40 PDT
,
Kenneth Rohde Christiansen
sam
: review-
Details
Formatted Diff
Diff
Patch 2
(11.60 KB, patch)
2010-09-24 07:14 PDT
,
Kenneth Rohde Christiansen
sam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2010-09-23 23:52:39 PDT
Comment on
attachment 68595
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=68595&action=review
> WebKit2/UIProcess/API/C/WKPreferences.cpp:160 > +void WKPreferencesSetStandardFontFamily(WKPreferencesRef preferencesRef, WKStringRef family) > +{ > + toWK(preferencesRef)->setStandardFontFamily(toWTFString(family)); > +} > + > +WKStringRef WebPreferencesGetStandardFontFamily(WKPreferencesRef preferencesRef) > +{ > + return toCopiedRef(toWK(preferencesRef)->standardFontFamily()); > +} > + > +void WKPreferencesSetFixedFontFamily(WKPreferencesRef preferencesRef, WKStringRef family) > +{ > + toWK(preferencesRef)->setFixedFontFamily(toWTFString(family)); > +} > + > +WKStringRef WKPreferencesGetFixedFontFamily(WKPreferencesRef preferencesRef) > +{ > + return toCopiedRef(toWK(preferencesRef)->fixedFontFamily()); > +} > + > +void WKPreferencesSetSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family) > +{ > + toWK(preferencesRef)->setSerifFontFamily(toWTFString(family)); > +} > + > +WKStringRef WKPreferencesGetSerifFontFamily(WKPreferencesRef preferencesRef) > +{ > + return toCopiedRef(toWK(preferencesRef)->serifFontFamily()); > +} > + > +void WKPreferencesSetSansSerifFontFamily(WKPreferencesRef preferencesRef, WKStringRef family) > +{ > + toWK(preferencesRef)->setSansSerifFontFamily(toWTFString(family)); > +} > + > +WKStringRef WKPreferencesGetSansSerifFontFamily(WKPreferencesRef preferencesRef) > +{ > + return toCopiedRef(toWK(preferencesRef)->sansSerifFontFamily()); > +} > + > +void WKPreferencesSetCursiveFontFamily(WKPreferencesRef preferencesRef, WKStringRef family) > +{ > + toWK(preferencesRef)->setCursiveFontFamily(toWTFString(family)); > +} > + > +WKStringRef WKPreferencesGetCursiveFontFamily(WKPreferencesRef preferencesRef) > +{ > + return toCopiedRef(toWK(preferencesRef)->cursiveFontFamily()); > +} > + > +void WKPreferencesSetFantasyFontFamily(WKPreferencesRef preferencesRef, WKStringRef family) > +{ > + toWK(preferencesRef)->setFantasyFontFamily(toWTFString(family)); > +} > + > +WKStringRef WKPreferencesGetFantasyFontFamily(WKPreferencesRef preferencesRef) > +{ > + return toCopiedRef(toWK(preferencesRef)->fantasyFontFamily()); > +}
Since all the getters here return copied strings, these need to have the word copy in them instead of get.
Kenneth Rohde Christiansen
Comment 2
2010-09-24 06:48:35 PDT
> > +WKStringRef WKPreferencesGetFantasyFontFamily(WKPreferencesRef preferencesRef) > > +{ > > + return toCopiedRef(toWK(preferencesRef)->fantasyFontFamily()); > > +} > > Since all the getters here return copied strings, these need to have the word copy in them instead of get.
Should they be called Copy instead of Get? I see that elsewhere in WebKit2. Like: WKPreferencesCopyFantasyFontFamily ?
Kenneth Rohde Christiansen
Comment 3
2010-09-24 07:01:06 PDT
(In reply to
comment #2
)
> > > +WKStringRef WKPreferencesGetFantasyFontFamily(WKPreferencesRef preferencesRef) > > > +{ > > > + return toCopiedRef(toWK(preferencesRef)->fantasyFontFamily()); > > > +} > > > > Since all the getters here return copied strings, these need to have the word copy in them instead of get. > > Should they be called Copy instead of Get? I see that elsewhere in WebKit2. > > Like: WKPreferencesCopyFantasyFontFamily ?
I should have read your comment better :-) still waking up.
Kenneth Rohde Christiansen
Comment 4
2010-09-24 07:14:32 PDT
Created
attachment 68676
[details]
Patch 2 Change Get to Copy.
Kenneth Rohde Christiansen
Comment 5
2010-09-24 10:58:48 PDT
Landed in 68258
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug