Bug 21492

Summary: [Cairo] Synthetic Bold/Oblique not working with cairo
Product: WebKit Reporter: Alexander Macdonald <alexmac>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: alexmac, alp, bfulgham, emacemac7
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: OS X 10.5   
Attachments:
Description Flags
patch for synthetic font support in cairo
none
patch for synthetic font support with cairo darin: review+

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. ***