summaryrefslogtreecommitdiff
path: root/vcl/source/font
AgeCommit message (Collapse)AuthorFilesLines
2017-11-23loplugin:simplifybool for negation of comparison operatorNoel Grandin1-1/+1
Change-Id: Ie56daf560185274754afbc7a09c432b5c2793791 Reviewed-on: https://gerrit.libreoffice.org/45068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-17tdf#111717 consider CJK vertical writing for underline offsetMark Hung1-1/+4
Textline offset was based on horizontal font metrics. In vertical writing for CJK fonts, use descent as its underline offset so that the line is drawn at the edge of the bounding box to prevent overlap the CJK glyphs. Change-Id: Iaa01bdf3cbb694dcf925975cde3f0f7ba7b97dac Reviewed-on: https://gerrit.libreoffice.org/44720 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-11-17vcl: clean ImplFontMetricData::ImplInitTextLineSize a little bit.Mark Hung1-15/+18
Move initialization of FullstopCenteredFlag out of ImplFontMetricData::ImplInitTextLineSize since it has nothing to do with text lines. Change-Id: I1c2e383d980514c8727d736a3158325c1e0ccfda Reviewed-on: https://gerrit.libreoffice.org/44712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
2017-11-09rename AvoidConfig to FuzzingCaolán McNamara1-5/+5
cause that's what its really used for and a couple of cases are not specifically about avoiding config but avoiding uninteresting disk acccess and what not Change-Id: I4c6454f98388579fcd0bf9798321d30408ab65ee Reviewed-on: https://gerrit.libreoffice.org/44491 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-24ofz#3748 Invalid-bool-valueCaolán McNamara1-3/+3
Change-Id: I5a14ff75c27062e33cbd93efb931c203135648a3
2017-10-23loplugin:includeform: vclStephan Bergmann9-26/+26
Change-Id: Id7dea3917740aaf4db8dada5e2bea6e117d714ea
2017-10-03tdf#107605: Fix line height cslculation for broken fontsKhaled Hosny1-5/+9
Change-Id: I06368dd15d7898dda61bc07b0f96bf82b00733b9 Reviewed-on: https://gerrit.libreoffice.org/43095 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-09-29ofz+ubsan: signed integer overflowCaolán McNamara1-1/+1
Change-Id: Ia8d0bb650d222ccda4c323eabebc4b1162fcf42f Reviewed-on: https://gerrit.libreoffice.org/42933 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-25vcl: [loplugin:badstatics] rename xDefaultImplFontCharMapMichael Stahl1-3/+3
It looks harmless. Change-Id: Ibe54b9059f46ced95602914bf852d342aef89905
2017-09-05Resolves: tdf#107249 round ascent/descent/extleading on conversion to intCaolán McNamara1-10/+15
Change-Id: Ia3ab5960d5288f5831aaa4ade800ca7513dad766 Reviewed-on: https://gerrit.libreoffice.org/41944 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-05Revert "Resolves: tdf#107249 round ascent/descent/extleading on conversion ↵Stephan Bergmann1-15/+10
to int" This reverts commit e2159061db8e266a3fe9f31773c676887168b254, it broke CppunitTest_vcl_complextext.
2017-09-05rename GetTTFontMterics -> GetTTFontMetricsNoel Grandin1-1/+1
Change-Id: I9952ddf0b1256e768a664f4da70455245cf67f41 Reviewed-on: https://gerrit.libreoffice.org/41934 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins <ci@libreoffice.org>
2017-09-05Resolves: tdf#107249 round ascent/descent/extleading on conversion to intCaolán McNamara1-10/+15
Change-Id: Iaf30b90762818c57fc0277e771b5bf172fb558be Reviewed-on: https://gerrit.libreoffice.org/41933 Reviewed-by: Michael Meeks <michael@gnome.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-07-31loplugin:oncevarNoel Grandin1-2/+1
extend oncevar to any POD type Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0 Reviewed-on: https://gerrit.libreoffice.org/40564 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18loplugin:constparams in vclNoel Grandin1-3/+3
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4 Reviewed-on: https://gerrit.libreoffice.org/40116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10loplugin:useuniqueptr in vclNoel Grandin1-5/+6
Change-Id: Ieece2f9728755a8ae91275535eaa39319eea274e Reviewed-on: https://gerrit.libreoffice.org/39740 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05new loplugin unnecessaryparenNoel Grandin2-2/+2
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-28loplugin:oncevar in vclNoel Grandin1-2/+1
Change-Id: I37a6dacda12e1c2910737d74aa344c7e2e195aeb Reviewed-on: https://gerrit.libreoffice.org/39328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use more SAL_N_ELEMENTS part 1Noel Grandin1-2/+2
- teach comphelper::containerToSequence to handle sized arrays - also use range based for-loop where appropriate. Change-Id: I73ba9b6295e7b29c872ee53de7a9340969e07f99 Reviewed-on: https://gerrit.libreoffice.org/38769 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-11ensure cow_wrapper contents are queried through a const pointerCaolán McNamara1-25/+25
otherwise the query will call make_unique to make this a unique copy of the underlying shared font which is a waste if the contents are going to be the same and the if branch contents are skipped. I was tempted to call the Font accessors like GetLanguage, etc. but a bunch of the accessors have two versions, a const and non-const one which behave differently so that looks like another rats nest This relates to the changes of commit 188439aac2e2e85821b4a114c1298bdf36a7b2ea Date: Fri Apr 22 23:43:52 2016 +0200 tdf#62525 vcl: use cow_wrapper for font Change-Id: Ic0661fccb414b3636308975e265fe5751476e1b8 Reviewed-on: https://gerrit.libreoffice.org/37502 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-08cleanup tools/debug.hxx includesJochen Nitschke1-1/+0
with command > git grep -l tools/debug.hxx | xargs grep -L DBG_ | xargs sed -i '/#include *\(<\|\"\)tools\/debug.hxx.*/d' don't change files in includes/ and */pch Change-Id: Ie429d6a7dca5dfa1073e0f5ba037f7c84bdbec08 Reviewed-on: https://gerrit.libreoffice.org/37349 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-28loplugin:salunicodeliteral: vclStephan Bergmann1-2/+2
Change-Id: I4a982da10ad76f8ae05355cec9629b906c95afdb
2017-04-26use strong_int for LanguageTypeNoel Grandin2-5/+5
Change-Id: If99a944f7032180355da291ad283b4cfcea4f448 Reviewed-on: https://gerrit.libreoffice.org/36629 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock1-0/+1
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna1-1/+1
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-25Fix typosAndrea Gelmini1-1/+1
Change-Id: I623135cd4c76dd6569f4ee521f97dee41de4cb1e Reviewed-on: https://gerrit.libreoffice.org/35660 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-14tdf#105454: Stop ignoring font kerning settingKhaled Hosny1-2/+2
Make sure the default is for kerning to be enable, and honor the setting to disable it. This also updates the expectations for chart2_xshape tests for file that had kerning disabled and was previously ignored. Change-Id: Icf6bb75e71cae43868fba323ca3c61e4a3e81523 Reviewed-on: https://gerrit.libreoffice.org/34169 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
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-12Get rid of "unicodes" in lower-case, tooTor Lillqvist1-2/+2
Instead, use "code points" (if you mean full 21-bit Unicode code points), or "code units" (if you mean the 16-bit units that make up UTF-16). Hopefully I got it right which one was meant in each case here. Change-Id: I8ee7a98996f1cebcfb95cd7d18a56570e48fa390
2017-02-12"Unicode" is a proper noun and should not be used in pluralTor Lillqvist1-4/+4
The 16-bit things that make up the UTF-16 encoding are called "code units". Change-Id: Iab2b83323783e518198c1a0553f7b053fc415985
2017-02-01An env var to disable font lookupKhaled Hosny1-0/+11
To be used in layout tests. Change-Id: I551b87786a4ad4ab34a22c458561109270fb4a31
2017-01-31teach lolugin:stringconstant about calling constructorsNoel Grandin1-2/+2
so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-10New loplugin:conststringvar: vclStephan Bergmann1-5/+5
Change-Id: I573c19e4a2f6ee041998216ea4cf29677986d731
2017-01-02Use FindMetricCompatibleFont() here as wellKhaled Hosny1-3/+5
Change-Id: I4b4c360a58f5e0176688294dc3d18aacfd000277 Reviewed-on: https://gerrit.libreoffice.org/32581 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-12-25Make sure we use bundled metric-compatible fontsKhaled Hosny1-3/+32
We were relying on FontConfig knowing about these replacements, but this does not work on Mac and might not even work on Linux if FontConfig is not configured to know these replacements. Since we bundle these fonts, we better making sure they end up being used. Change-Id: I26e72e8d1e5c902132e1260791e20017a92a5475 Reviewed-on: https://gerrit.libreoffice.org/32299 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2016-11-29Drop a bunch of font metrics flagsKhaled Hosny6-115/+14
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-22tdf#55469 Consistent line spacing across platformsKhaled Hosny1-0/+72
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-05Drop unused Graphite includesKhaled Hosny1-1/+0
Change-Id: Ib5c40931805ef8a484ccb52c5d2b81180f68f0cc
2016-11-04Font features are not a Graphite-only featureKhaled Hosny3-31/+12
We parse features appended to font names in CommonSalLayout as well, so code that takes care of their presence (striping them when searching, hashing, etc.) should not be dependent on the old Graphite support or it will not work when old Graphite is disabled (e.g. on macOS). Change-Id: If040782a86ec76d3743baf4d2b1d7a194e8e13f2
2016-10-31loplugin:oncevar in vbahelper..writerfilterNoel Grandin1-3/+1
Change-Id: Ifd7e91753d9652d6b1c535cde3cddf74757a2483 Reviewed-on: https://gerrit.libreoffice.org/30430 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-19Avoid AskConfig when setting font familyLuke Deller1-1/+1
Avoid calling the expensive ImplFont::AskConfig from Font::SetFamily as we are just going to overwrite the font family anyway. It looks like this crept in accidentally in the recent refactor commit e418d1a9c87ce01b75141f92dc249c7fb1a1bdcb Change-Id: I12a9bde77ffcc81f03c37ce400c59ea3a9acac31 Reviewed-on: https://gerrit.libreoffice.org/28901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-10-15clang-cl loplugin: vclStephan Bergmann1-1/+1
Change-Id: I40f8a6fef9d66b28a1d72551a6873b041b38b09e Reviewed-on: https://gerrit.libreoffice.org/29841 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-09-07loplugin:constantparam in vclNoel Grandin1-4/+3
Change-Id: I0cae8e5de1170dec4c82df7f1f5377143a079876 Reviewed-on: https://gerrit.libreoffice.org/28686 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-09-02coverity#1371325 Missing move assignment operatorCaolán McNamara1-7/+9
Change-Id: Iebe5ec7e2cdc6743dbabdecaa7cbb1c4a04893c4 Reviewed-on: https://gerrit.libreoffice.org/28610 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-09-02boost::intrusive_ptr->tools::SvRefCaolán McNamara2-46/+41
Change-Id: I4c913dc62efe3f3747e78670f4efb0216d95c4ad Reviewed-on: https://gerrit.libreoffice.org/28585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-08-29cid#1371168 Missing move assignment operatorNoel Grandin1-0/+10
Change-Id: I986b94df4aa8158f3e0623ab6cb392c178a820ce
2016-08-19Some clang-tidy misc-move-constructor-initStephan Bergmann1-1/+1
...by turning the relevant ctor parameters into "const &". Change-Id: Ia8d0aba5da10ad6b25f8689e2281e45b3d71c1fc
2016-07-27improve passstuffbyref return analysisNoel Grandin1-1/+1
Change-Id: I4258bcc97273d8bb7a8c4879fac02a427f76e18c Reviewed-on: https://gerrit.libreoffice.org/27317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-27loplugin:singlevalfields in vcl(part2)Noel Grandin1-2/+0
Change-Id: I4782c6f6d3d090ba0f9e29af8afdd7d88aa2d382 Reviewed-on: https://gerrit.libreoffice.org/26598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-17convert DBG_ASSERT in vclNoel Grandin1-1/+1
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3 Reviewed-on: https://gerrit.libreoffice.org/26200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>