<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I considered that but couldn't find a cairo_get_font_scale function quickly to complement the setter 😅</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">But yes, a full wrapper would transparently handle getting and setting.<br><br></div><div id="AppleMailSignature">- Harlan</div><div><br>On Dec 11, 2015, at 7:28 PM, Jack Lawrence <<a href="mailto:jackl@apple.com">jackl@apple.com</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=windows-1252">For getter-setter pairs like `setLineWidth`, you might consider turning them into properties:<div class=""><br class=""></div><div class=""><span style="font-family: Calibri; font-size: 16px;" class="">cairo.setLineWidth(0.1) // old</span></div><div class=""><span style="font-family: Calibri; font-size: 16px;" class="">cairo.lineWidth = 0.1 // new</span></div><div class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 11, 2015, at 4:22 PM, Gage Morgan via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Harlan,<div class=""><br class=""></div><div class="">The answer is yes. I even managed to get a couple you didn't list on my own:</div><div class=""><br class=""></div><div class=""><div class="">let cairo = Cairo(format: CAIRO_FORMAT_ARGB32, width: 421, height: 410)</div><div class="">cairo.scale(10.0, y: 10.0)</div><div class="">cairo.moveTo(29.0, y: 14.7)</div><div class="">cairo.lineTo(37.6, y: 13.0)</div><div class="">cairo.moveTo(37.6, y: 13.0)</div><div class="">cairo.lineTo(30.4, y: 22.2)</div><div class="">cairo.moveTo(30.4, y: 22.2)</div><div class="">cairo.lineTo(29.0, y: 14.7)</div><div class="">cairo.setLineWidth(0.1)</div><div class="">cairo.stroke()</div><div class="">cairo.surfaceWriteToPNG("boobs.png")</div><div class=""><br class=""></div><div class="">Swift is both really neat and really frustrating when learning it. </div><br class=""><div class=""><hr id="stopSpelling" class="">Subject: Re: [swift-users] Need Help with C-to-Swift (finally)<br class="">From:<span class="Apple-converted-space"> </span><a href="mailto:harlan@harlanhaskins.com" class="">harlan@harlanhaskins.com</a><br class="">Date: Fri, 11 Dec 2015 17:21:38 -0500<br class="">CC:<span class="Apple-converted-space"> </span><a href="mailto:kwame.bryan@gmail.com" class="">kwame.bryan@gmail.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">To:<span class="Apple-converted-space"> </span><a href="mailto:gagemorgan@outlook.com" class="">gagemorgan@outlook.com</a><br class=""><br class="">Gage,<div class=""><br class=""></div><div class="">Sorry, I just got back from class.</div><div class=""><br class=""></div><div class="">I’ll respond in line!</div><div class=""><br class=""><div class=""><blockquote class=""><div class="">On Dec 11, 2015, at 5:09 PM, Gage Morgan <<a href="mailto:gagemorgan@outlook.com" class="">gagemorgan@outlook.com</a>> wrote:</div><br class="ecxApple-interchange-newline"><div class=""><div class=""><div class="">Harlan,</div><div class=""><br class=""></div><div class="">I read on<span class="Apple-converted-space"> </span><a dir="ltr" href="http://cairographics.org/" target="_blank" class="">cairographics.org</a><span class="Apple-converted-space"> </span>about bindings awhile back. I think they want cairo, not surface, so we would have something like:</div><div class=""><br class=""></div><div class="">let cairo = Surface(format: CAIRO_FORMAT_ARGB32, width: 240, height: 80)</div><div class="">cairo.setFontFace("serif", weight: CAIRO_FONT_WEIGHT_BOLD)</div><div class="">cairo.setFontSize(32.0)</div><div class="">cairo.setSourceRGB(0.0, g: 0.0, b: 1.0)</div><div class="">cairo.moveTo(x: 10, y: 50)</div><div class="">cairo.showText("Hello, World!")</div><div class="">cairo.writeToPNG("hello.png")</div><div class=""><br class=""></div><div class="">Would this work the same as before without "surface" but instead "cairo”?<br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">Absolutely! That’s just a variable name — it could be called ‘puppies’, though that’s not very readable.</div><br class=""><blockquote class=""><div class=""><div class=""><div class=""><br class=""><div class="ecxacompli_signature">Sent from<span class="Apple-converted-space"> </span><a href="https://aka.ms/qtex0l" target="_blank" class="">Outlook Mobile</a></div><br class=""></div><br class=""><br class=""><br class=""><div class="ecxgmail_quote">On Fri, Dec 11, 2015 at 2:00 PM -0800, "Gage Morgan via swift-users"<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><br class=""></div><div class=""><div class="">I went and looked at it, and even now it looks like I want to take every function I've used in Cairo and translate it to Swift. Swift is such a...simple language compared to everything else. That being said, as a result of the specs, it is also much more verbose in terms of writing the code. Compared to other languages, it is written out instead of shoved onto a few lines. </div><div class=""><br class=""></div><div class="">Is there a way to import modules into other modules? Because it looks like a weekend project that will eventually get posted by myself at<span class="Apple-converted-space"> </span><a href="http://github.com/Christoffen-Corporation" target="_blank" class="">http://github.com/Christoffen-Corporation</a>. <br class=""><br class=""><div class="ecxx_acompli_signature">Sent from<span class="Apple-converted-space"> </span><a href="https://aka.ms/qtex0l" target="_blank" class="">Outlook Mobile</a></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I’d recommend having a look at the Swift package manager example again — <a href="https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md" target="_blank" class="">https://github.com/apple/swift-package-manager/blob/master/Documentation/SystemModules.md</a></div><div class=""><br class=""></div><div class="">There’s an example of using those modules together.</div><br class=""><blockquote class=""><div class=""><div class=""><div class=""><br class=""><div class="ecxx_gmail_quote">On Fri, Dec 11, 2015 at 1:52 PM -0800, "Gage Morgan via swift-users"<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:swift-users@swift.org" target="_blank" class="">swift-users@swift.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><br class=""></div><div class=""><div class="">I meant the code posted in the Gist link above. I don't know jack squat about qsort. I'm hoping that if I can reverse-engineer code already produced, I can apply it to other parts of Cairo. <br class=""><br class=""><div class="ecxx_x_acompli_signature">Sent from<span class="Apple-converted-space"> </span><a href="https://aka.ms/qtex0l" target="_blank" class="">Outlook Mobile</a></div></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">I’ll go ahead and comment it, but I think it’s simplistic enough that it should be readable with a grasp of some Swift concepts. Perhaps it’s a good idea to look through The Swift Programming Language to figure out some of the constructs I used — they’re fairly basic constructs.</div><br class=""><blockquote class=""><div class=""><div class=""><div class=""><div class=""><br class=""><div class="ecxx_x_gmail_quote">On Fri, Dec 11, 2015 at 1:34 PM -0800, "Kwame Bryan"<span dir="ltr" class=""><<a href="mailto:kwame.bryan@gmail.com" target="_blank" class="">kwame.bryan@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><br class=""></div><div style="word-wrap: break-word;" class="">Tutorial on the subject. <a href="http://chris.eidhof.nl/posts/swift-c-interop.html" target="_blank" class="">http://chris.eidhof.nl/posts/swift-c-interop.html</a> <div class=""><br class=""></div><div class="">Regards</div><div class="">Kwame</div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=-2FcgwiRAxmHDdptrhrsAJKMBtNqQpWV-2BwUfjpvH9AIapmo3-2BHsnvTus94jzsAd9QbgrzJUOBMUGL1vbZcJzhtyVp8DdIXzqymeEFv78CU98Vyvkel-2BZ9jAScwY1YDPFzrfK4k0wzAL0RYvODDsxuakhZXZY7WUvtIDD6jT8hO1G12IjFAP4zcPGisA85WWuoE0N2vgQ90Wpd69-2B1PAy-2FgJ6kuPbhfqVCSq9RdDYqcqzU-3D" alt="" width="1" height="1" border="0" style="height: 1px !important; width: 1px !important; border-width: 0px !important; padding: 0px !important;" class=""></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=-2FcgwiRAxmHDdptrhrsAJKMBtNqQpWV-2BwUfjpvH9AIapEPR-2FCXY9amYXSxN3Pbi2XrZMfHEN794BjyOKzqKEN1I5HM69Lqapv6DjsA6FzE8d9q3N3v71RBohhpxfFJmwu-2FppXm9-2F5fp7k5-2B6DDHtFIR52wVygcHpVKdRV8liNPtLvkthJRTxyuxSppBSc-2BI5r-2B9L8DyZNdiOAXPmJzd91Fd8lk3drIZ4JVKfkyoAcyrw-3D" alt="" width="1" height="1" border="0" style="height: 1px !important; width: 1px !important; border-width: 0px !important; padding: 0px !important;" class=""></div></div><span id="ecxcid:CAD42AA7-159A-44FE-8B20-00668767F2BB@student.rit.edu." class=""><Mail Attachment.txt></span><span id="ecxcid:0E99C342-6109-49EF-9D11-9ADA11D25B61@student.rit.edu." class=""><Mail Attachment.txt></span></div></blockquote></div><br class=""></div></div></div></div><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=fPHCHxM8OEqkFI0LoY8YMuXDKRTx6ILsXcJMmyHEOCK1g2WPDrZyFsR7DLDlbrRiEA6-2FGdzFprAFvdEcY7UBE0x-2BFtj95YctjkpAVfe-2Bq7SV4xEdQv70imgp6XrHB8UEaqlZ4BYO9LAYgBuaTOwze-2B3ZnRJhC4BIQTgABw48xeW5yEF4z8bM-2F5EoYoKcqCRXbycyP-2Frx8zSSDmVf9vC2vt-2BHI1Qh6R8GHcjxzdgIsXQ-3D" alt="" width="1" height="1" border="0" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span></span><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-users mailing list</span><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-users@swift.org" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-users@swift.org</a><br style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-users" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-users</a></div></blockquote></div><br class=""></div></div></div></blockquote></body></html>