<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div>I’ve been searching the archives for information on cairo_ft_font_face_set_synthesize but haven’t found anything yet.</div>
<div> </div>
<div>I’m trying to do something very simple.  I have a TTF font I am using with Cairo that doesn’t have bold or italics in it.  I can use the font by creating  new fontface using FreeType and cairo_ft_font_face_create_for_ft_face.  I’ve set the font data and
made the fontface my font in Cairo.  If generate output using Cairo anything that doesn’t require bold or italics it works just fine.</div>
<div> </div>
<div>However, I’ve tried doing some tests where call cairo_ft_font_face_set_synthesize with CAIRO_FT_SYNTHESIZE_OBLIQUE and/or CAIRO_FT_SYNTHESIZE_BOLD.  There appears to be no change in the font, so I’ve come to the conclusion that I’m not doing something
correctly.</div>
<div> </div>
<div>I’m doing this on Windows, so that may be an issue all by itself.  Anyway, here some basic code I’m using pulled from my code.</div>
<div> </div>
<div>void cairoDestroyFontFace(void *data);</div>
<div>void cairoDestroyFontFace(void *data)</div>
<div>{</div>
<div>    FT_Done_Face(static_cast<FT_Face>(data));</div>
<div>}</div>
<div> </div>
<div>.</div>
<div>.</div>
<div>.</div>
<div> </div>
<div>static FT_Library freetypeLibrary = nullptr;  // FreeType library instance</div>
<div>cairo_font_face_t*  fontFace = nullptr;</div>
<div>FT_Face ftFontFace = FT_Face();</div>
<div> </div>
<div>FT_Init_FreeType(&freetypeLibrary);</div>
<div>FT_New_Face(freetypeLibrary, "mytruetypefile.ttf", 0, &ftFontFace);</div>
<div> </div>
<div>if (ftFontFace != nullptr)</div>
<div>{</div>
<div>    fontFace = cairo_ft_font_face_create_for_ft_face(ftFontFace, 0);</div>
<div>}</div>
<div> </div>
<div>// set the font in cairo</div>
<div>if (fontFace != nullptr && cairo_status(cairoContext) == CAIRO_STATUS_SUCCESS)</div>
<div>{</div>
<div>    cairo_font_face_set_user_data(fontFace, &staticKeyForCairoUserData, ftFontFace, cairoDestroyFontFace);</div>
<div>    cairo_set_font_face(cairoContext, fontFace);</div>
<div>    cairo_ft_font_face_set_synthesize(fontFace, CAIRO_FT_SYNTHESIZE_OBLIQUE);</div>
<div>}</div>
<div> </div>
<div>// set the font size in cairo</div>
<div>cairo_set_font_size(cairoContext, 24);</div>
<div> </div>
<div>// draw some text</div>
<div>cairo_move_to(cairoContext, 20, 20); </div>
<div>cairo_show_text(cairoContext, "Simulated italic font...");</div>
<div> </div>
<div>FT_Done_FreeType(freetypeLibrary);</div>
<div>                </div>
<div>What I want is this:</div>
<div> </div>
<div><img src="cid:3B3E46705FD6D94C917086C645BB9235@xerox.com"> </div>
<div> </div>
<div>What I get is this:</div>
<div> </div>
<div><img src="cid:6232A654BD69FF459E30A0CAC4E24EB5@xerox.com"> </div>
<div> </div>
<div> </div>
<div align="center" style="text-align:center;"><font color="#943634"><img width="83" height="41" src="rtfimage://"></font></div>
<div> </div>
<div><font face="Xerox Sans" size="2"><span style="font-size:10pt;"><b>Glenn K. Smith</b>
<br>

<b>Software Developer</b></span></font></div>
<div><font face="Arial" size="1"><span style="font-size:8pt;">GDG - SSTO - Client Platform Development Team</span></font></div>
<div><br>

<font face="Xerox Sans" size="2"><span style="font-size:10pt;">Xerox Corporation <br>

800 Phillips Road, Mail Stop: 111-02A <br>

Webster, NY 14580<br>

Phone: 585-427-1450 (8*707-1450)</span></font></div>
<div style="margin-top:5pt;margin-bottom:5pt;"><font face="Xerox Sans" size="1" color="silver"><span style="font-size:7.5pt;">"This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential information.<font face="Calibri"> </font>
Any unauthorized review, use, disclosure or distribution is prohibited.<font face="Calibri"> </font> If you are not the intended recipient(s) please contact the sender by reply e-mail and destroy all copies of the original message. Finally, the recipient should
check that this email is authentic and examine it for the presence of viruses. Xerox does perform virus checks but cannot accept liability for any damage caused by any virus transmitted by this email. Thank you."</span></font></div>
<div> </div>
<div> </div>
<div> </div>
</span></font>
</body>
</html>