Bug 21492 - [Cairo] Synthetic Bold/Oblique not working with cairo
Summary: [Cairo] Synthetic Bold/Oblique not working with cairo
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Major
Assignee: Nobody
URL:
Keywords:
: 26120 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-08 18:01 PDT by Alexander Macdonald
Modified: 2009-07-16 09:07 PDT (History)
4 users (show)

See Also:


Attachments
patch for synthetic font support in cairo (2.64 KB, patch)
2008-10-08 18:02 PDT, Alexander Macdonald
no flags Details | Formatted Diff | Diff
patch for synthetic font support with cairo (5.35 KB, patch)
2008-10-13 15:42 PDT, Alexander Macdonald
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Macdonald 2008-10-08 18:01:52 PDT
The cairo port of webkit renders synthetic bold/oblique fonts as normal. This is not a bug, just a lack of implementation caused when the font handling code was reorganised sometime back in June.

The attached patch contains the cairo implementation for this feature
Comment 1 Alexander Macdonald 2008-10-08 18:02:58 PDT
Created attachment 24211 [details]
patch for synthetic font support in cairo
Comment 2 Alexander Macdonald 2008-10-08 18:12:01 PDT
Simple testcase:

<html>
<b>&#36196;&#12392;&#40658;&#12289;4&#12388;&#12398;&#12510;&#12540;&#12463;&#12289;13&#12398;&#25968;&#23383;</b>
<i>&#36196;&#12392;&#40658;&#12289;4&#12388;&#12398;&#12510;&#12540;&#12463;&#12289;13&#12398;&#25968;&#23383;</i>
<b><i>&#36196;&#12392;&#40658;&#12289;4&#12388;&#12398;&#12510;&#12540;&#12463;&#12289;13&#12398;&#25968;&#23383;</i></b>
</html>
Comment 3 Alp Toker 2008-10-09 20:40:13 PDT
(In reply to comment #1)
> Created an attachment (id=24211) [edit]
> patch for synthetic font support in cairo
> 

Hi Alex,

Please mark your patch r? if you want review.

You should fix up coding style (spaces, not tabs) and include a ChangeLog entry too (exact procedure is described on webkit.org).

Thanks
Comment 4 Alexander Macdonald 2008-10-13 15:42:52 PDT
Created attachment 24329 [details]
patch for synthetic font support with cairo
Comment 5 Alexander Macdonald 2008-10-13 15:44:41 PDT
Oops, sorry about that, I've attached a better patch that conforms to the webkit guidelines.
Comment 6 Eric Seidel (no email) 2008-10-21 14:39:04 PDT
Comment on attachment 24329 [details]
patch for synthetic font support with cairo

Style error:
 else {
 63         cairo_translate(cr, point.x(), point.y());
 64     }

But mitz should probably review this.
Comment 7 Eric Seidel (no email) 2009-05-22 07:40:55 PDT
Comment on attachment 24329 [details]
patch for synthetic font support with cairo

WebKit prefers const values to #defines:
+#define SYNTHETIC_OBLIQUE_ANGLE 14

This is what pixel tests were made for.  It saddens me that gtk still doesn't have pixel tests.
Comment 8 Darin Adler 2009-05-23 13:17:51 PDT
Comment on attachment 24329 [details]
patch for synthetic font support with cairo

> +    if(font->platformData().syntheticOblique()) {

Need a space after the "if" here.

Everything else looks OK, although the technique of drawing the text twice isn't the best known synthetic bold technique.

r=me
Comment 9 Brent Fulgham 2009-05-29 12:54:05 PDT
A really great change -- works wonderfully under Windows!

Landed in @r44268.
Comment 10 Brent Fulgham 2009-07-16 09:07:58 PDT
*** Bug 26120 has been marked as a duplicate of this bug. ***