summaryrefslogtreecommitdiff
path: root/vcl/quartz
AgeCommit message (Collapse)AuthorFilesLines
2017-08-08tdf#111497: fix leak in FindFontSubstitute with CFReleaseJulien Nabet1-0/+1
Change-Id: I9d7de52b4a1ee102b233b982e97ecbf731b476f2 Reviewed-on: https://gerrit.libreoffice.org/40895 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-07tdf#111432: fix leaks in AddTempDevFont with CFReleaseJulien Nabet1-0/+2
Change-Id: I11183b7fd21d2398de9e5f5854763cef96963caa Reviewed-on: https://gerrit.libreoffice.org/40845 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-08-07loplugin:casttovoidStephan Bergmann2-2/+0
Change-Id: Icda66259acf54e6771b926ce9d329287bd610e82
2017-08-07loplugin:unnecessaryparenStephan Bergmann2-2/+2
Change-Id: I9496cafef840195e3934bf92600d4e8c8edb6c26
2017-06-20new cannot return nullptrNoel Grandin1-6/+3
unless we are using std::nothrow Change-Id: I3bdd13c8ce18f4e977f18ee5196311bf4fc62de0 Reviewed-on: https://gerrit.libreoffice.org/38998 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-18remove unused osl/mutex.hxx includesJochen Nitschke1-1/+0
Change-Id: I3b50e45fdb99e9cd8bfda07356ee3ddb4dd0f8bb Reviewed-on: https://gerrit.libreoffice.org/38905 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-04-21remove unnecessary explicit linefeeds from end of SAL and OSL log callsNoel Grandin3-6/+6
Change-Id: I3fa363c8e76e6cfb297f4ec346e3f031c09d6fbf Reviewed-on: https://gerrit.libreoffice.org/36727 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna3-6/+6
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-28ofz#954 out of memoryCaolán McNamara1-0/+5
Change-Id: Ib27f2dfe0d0837544910208f38a1bc11a35e3cb4 Reviewed-on: https://gerrit.libreoffice.org/35794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-02Fix typosAndrea Gelmini1-1/+1
Change-Id: I72db7ff99cde394bc161dfd835bfb0d9a47a53d1 Reviewed-on: https://gerrit.libreoffice.org/34780 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-26Round glyph bbox on Mac similar to other platformsKhaled Hosny1-4/+5
Core Text API gives us float bounding box that we round ourselves, on other platforms we get rounding integers. Try to use the same rounding on Mac as FreeType does internally, hopefully this is the same on Windows. Change-Id: I7eb08464b008174270880575c4f3df28ede5c89d Reviewed-on: https://gerrit.libreoffice.org/34661 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-02-22tdf#104509: Fix GetGlyphBoundRect on MacKhaled Hosny1-2/+2
The rectangle top and bottom were mixed up! I tried to fix this in 8cef9b4dbafdebc0566d6d7f715f27f978ddfe5b, but it was not the right fix. Change-Id: Ia033ff2823bfd641e830d748d413d7791bfee5b8 Reviewed-on: https://gerrit.libreoffice.org/34557 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-02-09convert FontType to scoped enumNoel Grandin1-3/+3
Change-Id: Ieb8f90be8effde5f25bc872784c3ea2177b14bf9 Reviewed-on: https://gerrit.libreoffice.org/34056 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08drop unused enum TTCreationFlagsNoel Grandin1-1/+1
there is only one method using it, and all of the call sites pass 0 Change-Id: I5d71b36cf890fbcf0be9d795756da0cfd61ae309 Reviewed-on: https://gerrit.libreoffice.org/34024 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-02convert method names in tools::SvRef to be more like our other..Noel Grandin1-7/+3
reference classes, uno::Reference and rtl::Reference. Specifically rename Is()->is() and Clear()->clear(). Change-Id: Icb7e05e2d09cb9977121508b837ba0961dabb4ae Reviewed-on: https://gerrit.libreoffice.org/33576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-30tdf#104693: screenshot: fix mirrored mac screenshotsThorsten Behrens2-2/+10
Change-Id: Ie13689d7e15bf8dee6f21e6f5e7d75c9e53e931b Reviewed-on: https://gerrit.libreoffice.org/32543 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-12-12Don’t return false for blank glyphsKhaled Hosny1-0/+13
CTFontCreatePathForGlyph() will return NULL for blank glyphs causing CoreTextStyle::GetGlyphOutline() to return false which propagated as error all the way to OutputDevice::GetTextOutlines() causing it to needlessly enter into fallback code. Other implementations just return true and an empty polygon here. Change-Id: Ib20ebff00f7cb3aae22f1c6b4c3a0e9d7a429987 Reviewed-on: https://gerrit.libreoffice.org/31902 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11sal_GlyphId is a simple glyph id nowKhaled Hosny3-4/+4
No more cleverness. Change-Id: I760c602802961b37728c6987c4ade14fb02ca034 Reviewed-on: https://gerrit.libreoffice.org/31819 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11Don’t encode font fallback level in the glyph idKhaled Hosny1-2/+2
Change-Id: I747d969c3c1dc42b1a3b5d12d06fed3af9a64675 Reviewed-on: https://gerrit.libreoffice.org/31818 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-11Don’t encode the vertical flag in the glyph idKhaled Hosny2-3/+3
Change-Id: I00485dd4d42004e4eaa163a9e6ad0a43cf98a30a Reviewed-on: https://gerrit.libreoffice.org/31816 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Use GlyphItem in more placesKhaled Hosny2-11/+11
Change-Id: Ic0dd8c0311161271817eb9a3f454d00a319e43a8 Reviewed-on: https://gerrit.libreoffice.org/31814 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-10Pass GlyphItem aroundKhaled Hosny1-4/+4
We have this nice structure that contains (almost) all the information we need, so pass it around instead of passing separate fragments of said information. The ultimate is to kill the horrible sal_GlyphId hack if encoding various bits of information in the higher bits of a 32-bit integer. Change-Id: Ie496bb4c2932157527a388e2a94e46bf0a325a70 Reviewed-on: https://gerrit.libreoffice.org/31781 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-07convert PolyFlags to scoped enumNoel Grandin1-3/+3
and remove the XPolyFlags enum, which has the same values and was being converted to PolyFlags anyhow Change-Id: Iaead84933c79a7603698a4e50257dd944df89c41 Reviewed-on: https://gerrit.libreoffice.org/31627 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-06OSL_TRACE -> SAL_ in vclNoel Grandin1-1/+1
Change-Id: Icd317671a6b1b5356f0ccc7c59d50952fe20269b Reviewed-on: https://gerrit.libreoffice.org/31667 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-01Unused codeKhaled Hosny2-29/+2
Change-Id: Idfc964930c242d752a78cd109d75d809bce4de11 Reviewed-on: https://gerrit.libreoffice.org/31470 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Strip down GetEmbedFontData to what is really usedKhaled Hosny1-6/+1
The only remaining user is EmbeddedFontsHelper, and it just needs the raw font data. Change-Id: Ia15c59158b5c9e44d0936463553303a3c8b6e0f5 Reviewed-on: https://gerrit.libreoffice.org/31374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29SalGraphics::GetFontEncodingVector() is a noop nowKhaled Hosny1-7/+0
Change-Id: Id706fa242277a0ea7ba44f52eab4a56e404bd2fa Reviewed-on: https://gerrit.libreoffice.org/31372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Drop a bunch of font metrics flagsKhaled Hosny2-21/+0
These flags mean nothing these days, there are either always true or always false, since we no longer support bitmap or Type 1 fonts. Change-Id: Ie14ca480225a6346d868a44e58e7666c3a06931d Reviewed-on: https://gerrit.libreoffice.org/31346 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26Kill old Core Text layout engineKhaled Hosny5-951/+7
Change-Id: If80d65899255d8be72f374fbec232d103a08a006 Reviewed-on: https://gerrit.libreoffice.org/31232 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-26ServerFontLayout is already goneKhaled Hosny1-1/+1
Kill DrawServerFontLayout, and rename DrawSalLayout to DrawTextLayout, in parity with GetTextLayout. Change-Id: I3f61efd8c6ecde64f28301dca6a7c91eb0873702 Reviewed-on: https://gerrit.libreoffice.org/31224 Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Tested-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-22tdf#55469 Consistent line spacing across platformsKhaled Hosny1-6/+16
We current use platform APIs to calculate line spacing, however different platforms behave differently: * FreeType and Core Text will prefer hhea table over OS/2, and OS/2 Typo metrics over Win ones. * GDI’s TEXTMETRIC only uses OS/2 Win metrics, while NEWTEXTMETRIC seems to use Typo one, but we use only the old TEXTMETRIC. So we get inconsistent line spacing and we have no control which of three competing sets of line spacing metrics we end up using. The current conventional wisdom is that: * hhea metrics should be used, since hhea is a mandatory font table and should always be present. * But if OS/2 is present, it should be used since it is mandatory in Windows. OS/2 has Typo and Win metrics, but the later was meant to control text clipping not line spacing and can be ridiculously large. Unfortunately many Windows application incorrectly use the Win metrics (thanks to GDI’s TEXTMETRIC) and old fonts might be designed with this in mind, so OpenType introduced a flag for fonts to indicate that they really want to use Typo metrics. So for best backward compatibility: * Use Win metrics if available. * Unless USE_TYPO_METRICS flag is set, in which case use Typo metrics. This patch does this by reading the hhea and OS/2 tables directly and implementing the algorithm above. Quick comparison with Microsoft Office 2016 shows similar line spacing as the new line spacing here, so I guess we are improving compatibility as well. Change-Id: I4541e67e3e14508e3529e73083056a09de02e637 Reviewed-on: https://gerrit.libreoffice.org/31053 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-13tdf#103895: Another fix too macOS glyph boundingKhaled Hosny1-1/+5
Apply font rotation when calculating glyph bounding rectangle. Change-Id: I9c533ec3b33a5858d46b60d1700a50d3b6f915a4
2016-11-13Simplify vertical text drawing on macOSKhaled Hosny1-36/+31
Rotate only the rotated glyphs instead of rotating everything, then unrotating the upright glyphs. No need for a rotated font either, rotating the graphics is fine. Change-Id: I1fce2c9c6a29abb1353a5fc8485a9c0d34edfbf1
2016-11-13Fix buildKhaled Hosny1-2/+0
Change-Id: I55db5ba855b8d72e9be0298a68b094c7b01d9f54
2016-11-13Unused codeKhaled Hosny1-59/+0
Change-Id: Ief0942e7e3dfb7a550bcd1de99e4630831438c86
2016-11-07-Werror,-Wdeprecated-declarationsStephan Bergmann1-0/+4
Change-Id: Ia54f11b799fefcddcbf3b9f49e806bfc0895773f
2016-11-07Set Kashida width also on macOSKhaled Hosny1-0/+9
Otherwise we might not get any Kashida justification at all. Change-Id: I6521d5a267392314d5d0da84b93fcd80c7b7cc57
2016-11-02Fix GetGlyphBoundRect() on macOSKhaled Hosny1-2/+2
The Y sign should be reversed to match VCL, apparently it was either unused on macOS before CommonSalLayout or it was wrong all along. This was the source of CppunitTest_svgio failure on macOS with CommonSalLayout. Change-Id: I3108aab7b6780c912e86e5591ca0f41ea437137b
2016-10-25Skip font formats not supported by CommonSalLayoutKhaled Hosny1-0/+14
Don’t list fonts we can’t handle, bad things would happen… Change-Id: Ic88486e34da69090deb3e8c394cb75a8e4e5cbd0
2016-10-18Rewrite AquaSalGraphics::DrawSalLayout()Khaled Hosny1-22/+67
Slightly cleaner code and now handles glyph rotation for vertical text. Change-Id: I98cc8fd7df5e73068294e4d7dd6b38a71dcbdcc7
2016-10-18Support font fallback on macOS for CommonSalLayoutKhaled Hosny2-30/+107
Change-Id: Ifd26b7f14ed77a3aa2a38e5961cac5f9bbb6d796
2016-10-18Check SAL_USE_COMMON_LAYOUT envar in one placeKhaled Hosny1-1/+1
Makes it easier to flip the switch in the future (or even do something more fancy other than checking envvar). Change-Id: Ie42ca012c167b2108f0fca1ce9ff7beee95f1be7
2016-10-18Cache HarfBuzz fontKhaled Hosny1-3/+3
We now create it only once per physical font, saves us few percents from the all over time spent on layout. Change-Id: I8de582cb20a168c93d72921e539c2477fa97fb54
2016-10-18GSoC: Speed up CommonSalLayout by caching hb_faceAkash Jain1-0/+3
Cache hb_face so it is not created again and again. Switch from GDI to DirectWrite on Windows to obtain SFNT table data. Change-Id: I9c532cd72e1f6b57313f3b7d42a6b9b0633eb0ef
2016-10-18GSoC: Integrate new CommonSalLayout in quartz/ codeAkash Jain4-40/+41
Change-Id: I07a9c956f09be5d43ee58ff0784ba0f81f52cd9a
2016-10-18GSoC: Modify DrawServerFontLayout and add DrawSalLayoutAkash Jain1-1/+2
Modify the definiton of the DrawServerFontLayout method. Add new DrawSalLayout method which will be used for drawing text independent of the platform. Change-Id: Ie3eefb172b1781c685def1ef549db2538f672a62
2016-10-18GSoC: Add new CommonSalLayout classAkash Jain1-0/+1
Change-Id: Ic11e573da2f5fd6ef931f53ab674f8894815c3b4
2016-10-10tdf#89307: Removed SvRef::operator T*()Jacek Fraczek1-4/+4
Conditional statements are using SvRef::Is() method. Changed static_cast<T*>(svRef<T>) occurances to svRef.get(). Added operator == and != to SvRef. SbxObject::Execute is using SbxVariableRef internally. SbxObject::FindQualified is using SbxVariableRef internally. Change-Id: I45b553e35d8fca9bf71163e6eefc60802a066395 Reviewed-on: https://gerrit.libreoffice.org/29621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-23tdf#100994: use CGContextStrokePath insteadJulien Nabet1-2/+2
This is a blind fix attempt to fix "Freeze when first action after launch with OSX Sierra with iMac 5K" I started from bt: frame #9: 0x00007fffbe094cf6 CoreGraphics`CGContextDrawPath + 183 frame #10: 0x0000000102b16cda libvcllo.dylib`AquaSalGraphics::drawPolyLine(unsigned int, SalPoint const*) + 330 frame #11: 0x0000000102929039 libvcllo.dylib`OutputDevice::drawPolyLine(tools::Polygon const&, LineInfo const&) + 361 frame #12: 0x0000000102928d30 libvcllo.dylib`OutputDevice::DrawPolyLine(basegfx::B2DPolygon const&, double, basegfx::B2DLineJoin, com::sun::star::drawing::LineCap, double) + 768 (see https://bug-attachments.documentfoundation.org/attachment.cgi?id=127502) then: http://stackoverflow.com/questions/32871234/how-to-make-kcgpathstroke-work-in-swift-2 which advises to replace: CGContextDrawPath(ctx, kCGPathStroke) by CGContextDrawPath(ctx, .Stroke) and finally this: http://stackoverflow.com/questions/37838578/how-to-stroke-a-cgpath which advises to directly use this: CGContextStrokePath(context) Change-Id: I99f9800c39f18d16488f7ef4114a71722f9b8123 Reviewed-on: https://gerrit.libreoffice.org/29194 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-14loplugin:overrideStephan Bergmann1-1/+1
Change-Id: Ica137897f02c5caa4c4891f75531ada3957025d9