summaryrefslogtreecommitdiff
path: root/vcl/inc/impfont.hxx
AgeCommit message (Collapse)Author
2019-02-22loplugin:unusedfields in vclNoel Grandin
maStatusText in HelpTextWindow is dead since commit bd3ea40ed49074c4fa4439de7b5dea4fc3161880 Date: Fri Jan 21 14:48:58 2011 +0200 Remove ShowHelpStatusText and HideHelpStatusText and associated cruft Change-Id: I7a74e2a1b909a479f9338bd4da5fad06ccc25283 Reviewed-on: https://gerrit.libreoffice.org/68153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-08Make Color a forward declarationChris Sherlock
Change-Id: Ib28833555661b119de8e967b05e3c8691fca826a Reviewed-on: https://gerrit.libreoffice.org/43227 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-11-29Drop a bunch of font metrics flagsKhaled Hosny
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-09-02boost::intrusive_ptr->tools::SvRefCaolán McNamara
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-06-01loplugin:unusedmethodsNoel Grandin
Change-Id: Ia7981447e96d9ac87526ad1276585ab3077d7f08 Reviewed-on: https://gerrit.libreoffice.org/25707 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-20loplugin:unusedmethods in vclNoel Grandin
also drops the CairoFontsCache ref-counting, since nothing was actually using it. Change-Id: If05ecb054b6b8d97b0d3010185cf23c28390ec04 Reviewed-on: https://gerrit.libreoffice.org/25105 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-25tdf#62525 vcl: use cow_wrapper for fontXisco Fauli
Change-Id: Ib08d2a20c7b8dab9772c568eb4ccb8e235a30eee Reviewed-on: https://gerrit.libreoffice.org/24308 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2016-04-14loplugin:passstuffbyref in vclNoel Grandin
Change-Id: I17a4dc73c3fc81b0bfebdf442021af65f8f6166c Reviewed-on: https://gerrit.libreoffice.org/24075 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-04vcl: take into account the font width is the average font widthChris Sherlock
I'm changing the Font class function names: - SetSize -> SetFontSize - GetSize -> GetFontSize - SetHeight -> SetFontHeight - GetHeight -> GetFontHeight - SetWidth -> SetAverageFontWidth - GetWidth -> GetAverageFontWidth That's because it really makes no sense to say that there is a single constant font width because obviously proportional fonts don't have one - the best we can do is an average font width, which is what folks like Microsoft sort of do already. On a fixed font, the average is still accurate, for obvious reasons :-) I'm also not a fan of GetSize/SetSize as I find it a might too generic. Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70 Reviewed-on: https://gerrit.libreoffice.org/22069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-02vcl: minor formattingChris Sherlock
Change-Id: I7cc82556d0c1fe874bf112052300217a0162c5bb
2016-01-31tools: rename FontUnderline to FontLineStyleChris Sherlock
Change-Id: I4750ad8569a1003b2f8c29052f3e25003ee433ca Reviewed-on: https://gerrit.libreoffice.org/21892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-29vcl: move mnOrientation down header fileChris Sherlock
ImplFont::mnOrientation is actually a font metric, it really should be moved to ImplFontMetric so added a TODO. Change-Id: If0f39be16a782692a0da68c674fc87c474dd6468
2016-01-29vcl: rename ImplFont::mnKerning to ImplFont::meKerningChris Sherlock
Change-Id: Iacbe55037b75d30522435f854ceeef432ccfb406
2016-01-29vcl: update comment about mbConfigLookupChris Sherlock
Change-Id: I468bd1810b10be6fab1abcd82cee46dd0b5022d0
2016-01-29vcl: more harmonization of ImplFont and FontAttributesChris Sherlock
+ Added function ImplFont::CompareDeviceIndependentFontAttributes + Renamed ImplFont::mbSymbol to ImplFont::mbSymbolFlag Change-Id: I6325e87a2f38a9949c990453112284c3f8d1fb2f
2016-01-29vcl: move NoAsk() functions to own grouping in impfont.hxx headerChris Sherlock
Change-Id: I361fa3be7dc974dbeefc05820c508cfc7098775d
2016-01-29vcl: add text alignment functions to ImplFont and FontAttributesChris Sherlock
ImplFont and FontAttributes now have GetAlignment and SetAlignment, and I have renamed Font::GetAlign to Font::GetAlignment, and Font::SetAlign to Font::SetAlignment. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test text alignment. Change-Id: I6272c84fc9416c90616d957d1897eba9469fe7ba Reviewed-on: https://gerrit.libreoffice.org/21876 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-25vcl: header cleanup of impfont.hxxChris Sherlock
Change-Id: I87fb69d96ced5d991b589284df1a52b9593675a4
2016-01-23vcl: add size property to the ImplFont classChris Sherlock
I'm adding size getters and setters to the ImplFont class. But size is a font *metric*, so surely this should be in ImplFontMetric? Something I'm going to have to look into soon so that I can harmonize these classesi with ImplFontMetricData and FontAttributes, then eventually merge them. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test this flag. Change-Id: I4a7ef39ffb60257b428757f54aa6487bfdd8c86c Reviewed-on: https://gerrit.libreoffice.org/21721 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-22vcl: reorder and correctly initialize ImplFont private variablesChris Sherlock
Change-Id: I12b4f066c71ab5a0506c833b688fae741d0a5a8b Reviewed-on: https://gerrit.libreoffice.org/21718 Tested-by: Chris Sherlock <chris.sherlock79@gmail.com> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-22vcl: add orientation flag property to Font classChris Sherlock
Add getter and setter for orientation flag to the Font class. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test this flag. Change-Id: I62d5a47f870702eeac4625830dd279dd53fbcc3d Reviewed-on: https://gerrit.libreoffice.org/21696 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-22vcl: add font map names to Font classChris Sherlock
Added getter and setter for font map names to the Font class. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Change-Id: I3e12c900da6f3abe60ea9c8dc39178fdd3f98bb7 Reviewed-on: https://gerrit.libreoffice.org/21695 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-21vcl: add subsettable flag property functions to Font classChris Sherlock
Added getter and setter for subsettable flag property to the Font class. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test this flag. Change-Id: I2a66f1c4876698e1ffeaf260b2b43d5308b71191 Reviewed-on: https://gerrit.libreoffice.org/21651 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-21vcl: remove Font::GetFamily and Font::GetFamilyNoAsk (obsolete functions)Chris Sherlock
Change-Id: I345fe86b5cfe1dde1aa4082a7943e8a9f228fe03 Reviewed-on: https://gerrit.libreoffice.org/21649 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-21vcl: add embeddable font property functions to Font classChris Sherlock
Added setter and getter for embeddable font property to the Font class. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test this flag. Change-Id: I7f4ddf09d4a122c7c335b017efcb95f1774ae0d8 Reviewed-on: https://gerrit.libreoffice.org/21650 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-20vcl: add built in font property functions to Font classChris Sherlock
Added setter for built-in font property and IsBuiltInFontFlag to Font class. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test added to vcl/qa/cppunit/font.cxx to test this flag. Change-Id: I61ce33fe6ffb31be22c68ce8a94d0886ebdc8fcf Reviewed-on: https://gerrit.libreoffice.org/21627 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-20vcl: add more property functions to FontChris Sherlock
Added increase and decrease quality functions to Font class, and also charset mutator and accessor function. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit test change in vcl/qa/cppunit/font.cxx: - enhanced to check increase and decrease quality functions Change-Id: I2f5970438f6ef1ad185163d5fdcec5bbc88912a4 Reviewed-on: https://gerrit.libreoffice.org/21622 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-20vcl: fix comments in impfont.hxxChris Sherlock
Change-Id: I7942cf513439f8fe72775846eeb4cf4e6f176ed3
2016-01-19vcl: add quality accessor & mutator to FontChris Sherlock
Change-Id: I261c717cabf966b8b20b8e6c921b38f4cd73e268 Reviewed-on: https://gerrit.libreoffice.org/21597 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-19vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic()Chris Sherlock
This brings FontAttributes into line with ImplFont and Font, which is important to the refactoring work I am doing. Change-Id: I08160992834f3732738b40aae9264df00443795a Reviewed-on: https://gerrit.libreoffice.org/21576 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16vcl: created accessors and mutators for font classesChris Sherlock
Font accessors: - GetFamily() - GetPitch() - GetWidthType() - GetWeight() - GetItalic() - GetName() <--- shouldn't that be GetFamilyName()?!? - GetStyleName() Font mutators did not need to be added. Font unit tests are testing: - Setting and getting FontFamily private member - Setting and getting FontPitch private member - Setting and getting FontWidth private member - Setting and getting FontWeight private member - Setting and getting FontItalic private member - Setting and getting the family name and style ImplFont accessors: - GetFamilyNoAsk() - GetPitchNoAsk() - GetWidthTypeNoAsk() - GetWeightNoAsk() - GetItalicNoAsk() - GetFamilyName() - GetStyleName() (These "NoAsk" functions are necessary because the default getters call on a function that checks the configuration for default values, something that is not wanted in all cases). Change-Id: Icfbc8b4e5253d55a80892df050b0803dfc7d7c9f Reviewed-on: https://gerrit.libreoffice.org/21501 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16vcl: ImplFontMetric and FontAttributes is *very* familiarChris Sherlock
So much so that I think we only need one or the other. As such, I'm implementing the functionality that is in one of the classes so that (and vice versa) might eventually be able to use the same class! Change-Id: I1b32a5a5213ea406a96386ac4a4553cd81d3728d
2016-01-15vcl: add symbol and charset accessors and mutators to FontChris Sherlock
Rules for the vcl::Font class for setting character set and the symbol flag: If the characterset changes to anything other than RTL_TEXTENCODING_SYMBOL then the symbol flag should be off. If the characterset changes to RTL_TEXTENCODING_SYMBOL then the symbol flag should be on. If the symbol flag is set to false and the characterset is already RTL_TEXTENCODING_SYMBOL then set the characterset to RTL_TEXTENCODING_DONTKNOW and set the symbol flag to false. However, if we are setting the symbol flag from false to false (i.e. we know the characterset) then we can keep the characterset as it is. Unit test written in this commit to test this is working. Change-Id: Iced44659ab88ff66b711c560cb68bd4681ecb537
2016-01-15vcl: make constructors of ImplFont explicitChris Sherlock
Change-Id: I7d65f6fa8d20d96261cf8d63383902e68c39882a
2016-01-14vcl: remove unnecessary headers in impfont.hxxChris Sherlock
Change-Id: I509b517354a61f03e0b4ccc681a643f448c5f12f
2016-01-14vcl: split off ImplFontMetric into impfontmetric.hxxChris Sherlock
The fact that there is now an impfontmetricdata.hxx and an impfontmetric.hxx file in the same folder highlights the need for refactoring :-) Change-Id: Ic81f32cfa8523dccabe7b419bf97f1566e2d67da
2016-01-14vcl: ImpFontMetric and FontMetric no longer friends with OutputDeviceChris Sherlock
Exposng your private members as public is bad, but its also unacceptable to allow friends to access your private members. It's not the done thing in civilized C++ society. Change-Id: Id8f811f0e775afde26c6119b274f37908731507c
2016-01-14vcl: Create mutator for bullet offset attribute in FontMetricChris Sherlock
Mutator created for bullet offset attribute in FontMetric. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can get and set bullet offset attribute - check equality operator on FontMetric after setting bullet offset attribute Change-Id: I87a76982a8b3ed697664299cb340fa35fb514c0e
2016-01-14vcl: Create mutator for slant attribute in FontMetricChris Sherlock
Mutator created for slant attribute in FontMetric. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can get and set slant attribute - check equality operator on FontMetric after setting slant attribute Change-Id: I5490a40dba4c86386d59a42f2d04303b3fc4d536
2016-01-14vcl: Create mutator for line height attribute in FontMetricChris Sherlock
Mutator created for line height in attribute FontMetric. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can get and set line height attribute - check equality operator on FontMetric after setting line height attribute Change-Id: I86dff217fa24850b5f9d04a17ddda464dfb0156a
2016-01-13vcl: Create accessor and mutator for ascent and descent in FontMetricChris Sherlock
Accessor and mutator created for ascent and descent spacing in FontMetric. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can set font ascent and descent spacing - check equality operator on FontMetric after setting both ascent and descent font spacing Change-Id: I714363b14bdc61ddfa37a619fe4b03f4e4e96f7a Reviewed-on: https://gerrit.libreoffice.org/21458 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: Create accessor and mutator for int and ext leading in FontMetricChris Sherlock
Accessor and mutator created for external and internal leading space in FontMetric. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can set external and leading space - check equality operator on FontMetric after setting both external and internal leading space - enhanced tests to also check the inequality operator Change-Id: I973970dd0b0631c5eca3e89039dce57ac3a3eb63 Reviewed-on: https://gerrit.libreoffice.org/21454 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: remove ImplFontMetrics::mnMiscFlags as no longer usedChris Sherlock
Change-Id: I4ae251107fb754835c0f70ca531fc93557d2ca31 Reviewed-on: https://gerrit.libreoffice.org/21416 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: ImplFontMetric - all uses of enum now removedChris Sherlock
Change-Id: I17d95627e66fcc771a6b248d93d169d0ecadcb82 Reviewed-on: https://gerrit.libreoffice.org/21415 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: Create accessor and mutator for builtin font flag in FontMetricChris Sherlock
Accessor and mutator created for builtin font flag, removed the existing bit field. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can set builtin font flag - check equality operator on FontMetric after setting builtin font flag Change-Id: Iac3f4270f86d10f9dcd0bb6e3951c0e983a4f22f Reviewed-on: https://gerrit.libreoffice.org/21414 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: Create accessor and mutator for full stop centered in FontMetricChris Sherlock
Accessor and mutator created for full stop centered flag, removed bit field. See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor and mutator for font scaling in FontMetric") for reasoning behind patch. Unit tests - check to ensure that can set full stop centered flag - check equality operator on FontMetric after setting full stop centered flag Change-Id: I9cacb0fbf9ea65cfebcaebdc9f0481c0a796cbcf Reviewed-on: https://gerrit.libreoffice.org/21413 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: format enum in ImplFontMetric to make it easier to rebaseChris Sherlock
Change-Id: Ic2e7213254b60cf3c384dd7ab4696092dbbc5108 Reviewed-on: https://gerrit.libreoffice.org/21412 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-13vcl: Create accessor and mutator for font scaling in FontMetricChris Sherlock
This is fragile code! There are actually *two* classes that do almost precisely the same thing, they are: - ImplFontMetric, and - ImplFontMetricData They both have much in common, including their class name, and even most of their functionality. In fact, they both have common accessor functions. When I look at the code, it looks like OutputDevice is actually given an ImplFontMetricData object, which it then uses to populate an ImplFontMetric object... Basically, I'm going to merge these classes. To do so, I'm going to do the following: Step 1: Implement accessor functions for ImplFontMetric and FontMetric (then remove the friendship of this class to OutputDevice!) Step 2: Write a unit test for each accessor function in ImplFontMetric Step 3: Ensure that ImplFontMetric and ImplFontMetricData use some sort of smart pointer (probably an intrusive_ptr like I did ages ago with FontCharMap) Step 4: Merge the two classes together once their class interfaces are the same and I am satisfied they do the same thing Step 5: Find all instances of inefficient usage - for instance, I can do away with the code that copies the ImplFontMetricData attributes into an ImplFontMetric object. Change-Id: I07c1cb848774b130fa2ca60b51da53e07754dd00 Reviewed-on: https://gerrit.libreoffice.org/21399 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-12vcl: change from Impl_Font to ImplFontChris Sherlock
Change-Id: I5edacec5c74398777ab0006c0d4e76d7d3050876 Reviewed-on: https://gerrit.libreoffice.org/21376 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-12vcl: put FontConfigFontOptions into Unix headerChris Sherlock
Change-Id: I7b326d8fc8d2b6ecd9642ba958015285d0929a44 Reviewed-on: https://gerrit.libreoffice.org/21341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>