summaryrefslogtreecommitdiff
path: root/vcl/inc/PhysicalFontFace.hxx
AgeCommit message (Collapse)Author
2021-10-05vcl: test PhysicalFontFace and move to vcl::font namespaceChris Sherlock
- moved PhysicalFontFace.hxx to vcl/inc/font - added PhysicalFontFace to vcl::font namespace - had to regenerate precompiled_vcl.hxx - tested PhysicalFontFace, with some extensive tests for IsBetterMatch() Change-Id: I860022ac244f8a827f6f9cb7ed9018c5d9c328cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121970 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-27vcl: move FontSelectPattern to own file and into vcl::font namespaceChris Sherlock
Change-Id: I2f01a8e67c52ece9b434777203aa9fbc9ac8be02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122613 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
2021-09-21vcl: remove OutputDevice's GetDevFontSizeCount() and GetDevFontSize()Chris Sherlock
The OutputDevice::GetDevFontSize() function is only used for non-scalable (bitmap) fonts. We have stopped supporting bitmap fonts since LO 5.3, see tdf#103514: Support for bitmap-only fonts on Windows has been removed (Khaled Hosny) I found the following when removing PhysicalFontFace::SetBitmapSize(): 1. as mnHeight and mnWidth and not set by anyone, I realized I could remove them, which meant removing GetHeight() and GetWidth() 2. PhysicalFontFamily::GetFontHeights() populates heights from the collection of font faces into a sorted vector of font heights taken from PhysicalFontFace. As this no longer exists this function serves no purpose, it has been removed. 3. PhysicalFontFamily::GetDeviceFontSizeList() calls upon PhysicalFontFace::GetFontHeights(). This function takes this sorted list of font heights, and then populates and returns a new list of sizes (or rather, heights). As the heights aren't available any more, this function is also unneeded, so it has been removed. 4. OutputDevice::GetDevFontSizeCount() calls upon PhysicalFontFamily::GetDeviceFontSizeList(). This function has the side effect of initializing the list of fonts. 5. When I checked what calls on GetDevFontSizeCount(), there is only one caller - FontList::GetSizeAry() in svtools. The function returns a standard font size list if the family name is empty, or there are no font sizes (via OutputDevice::GetDevFontSizeCount()). As this will *always* be empty (see chain above) then this function just needs to always return a standard font size list. Thus OutputDevice::GetDevFontSizeCount() and GetFontSizeList() are no longer called upon by anything, so they can be removed. 6. svtool's FontList::GetSizeAry() no longer uses the FontMetric parameter, so this has been removed from the function signature, and cleanup done of the function that calls upon it in svtools, framework, editeng, and desktop. A number of variables that were no longer used due to this change were also removed. 7. This change removed the need for the mpSizeAry unique_ptr in FontList. ImplFontListFontMetric::GetDevice() and mpDevice could also be removed as it was no longer used anywhere. 8. After simplifying GetSizeAry(), it turns out it was the same as GetStdSizeAry(), so removed FontList::GetSizeAry() and used FontList::GetStdSizeAry() in its place. 9. Changing to use GetStdSizeAry() revealed that FontSizeBox::Fill() no longer used the pFontMetric paramter, so this was removed, and call sites updated. 10. Due to change to Fill(): a. SvxFontSizeBox_Base::UpdateFont() no longer uses the const css::awt::FontDescriptor& rCurrentFont parameter, so removed this. This also removed the member variable m_aCurrentFont b. SvxCharNamePage::FillSizeBox_Impl() had a number of newly unused variables removed. c. SwStdFontTabPage::Reset() and SwStdFontTabPage::LoseFocusHdl() had a number of newly unused variables removed. Change-Id: If840e240155c36ed351c63e3136b5b44bb058697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121932 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-20vcl: unneeded functions in PhysicalFontFaceChris Sherlock
Nothing uses PhysicalFontFace::SetBitmapSize(), so remove it. This in turn meant that the class doesn't ever use CompareWithSize() directly, as this calls on CompareIgnoreSize() when no width or height is set I have removed CompareWithSize(). Change-Id: I1012ffd3bc0f39f917a8b725f9985844967533dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121931 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-19vcl: test PhysicalFontFamily and move to vcl::font namespaceChris Sherlock
- Adds a series of unit tests for PhysicalFontFamily - Moves PhysicalFontFamily into vcl::font - Move PhysicalFontFamily.hxx into vcl/inc/font This is part of a series of patches where I also move font files into the relevant font directories, and into the vcl::font namespace. Change-Id: I9e8d7ceb5ec3494bf3ab6560645e52e88223ee69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121903 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-18vcl: add sal/config.h in preparation for patchChris Sherlock
The convention is that we need to add sal/config.h to the start of files. I have a patch queued to test PhysicalFontFamily and move it to vcl::font. Submitting patch to update the modelines in the files that I will change in that patch. Change-Id: I92275250bc5e12f7e6f7c0d4b6405d6a6e8de033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122179 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-10-19use tools::Long in vclNoel
Change-Id: Ice1055021e8568634e9a66ba89d3bb4ef4e731df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104522 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-15VCL register common functions in PhysicalFontFaceJan-Marek Glogowski
This makes GetFontCapabilities and GetFontChatMap members of the PhysicalFontFace. These are implemented in all the real font face classes anyway. Also provide dummies for the PDF buildin fonts. Change-Id: Icb8cb14480ce1e020977b8f69892095d787982ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102683 Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> Tested-by: Jenkins
2018-10-30Move SalGraphics glyph functions into FontInstanceJan-Marek Glogowski
As we already rely on the GlyphItem's font instance, consequently this removes the SalGraphics GlyphItem based functions. Also unifies the glyph bound rect cache handling. An interesting aspect is the rotated glyph bounding box handling moved from CairoTextRender to FreetypeFont. It doesn't look like an implementation detail for Cairo, so it may have been a bug. Change-Id: I81bbb5d8ee98fb77a1eee05568c456f9e4553023 Reviewed-on: https://gerrit.libreoffice.org/62503 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-08-22rename FontSelectPatternAttributes to FontSelectPatternCaolán McNamara
Change-Id: I2c018e2e61707c0d89178b0cb38a0918906e23cb Reviewed-on: https://gerrit.libreoffice.org/59390 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-22turn the cache around to work on LogicalFontInstanceCaolán McNamara
instead of a FontSelectPattern with an associated LogicalFontInstance use a LogicalFontInstance with owned FontSelectPatternAttributes Change-Id: I939f84731fcb8db5ff6484dcfbd2f9199bb50d23 Reviewed-on: https://gerrit.libreoffice.org/59388 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-21Missing declaration (when compiling vcl/qt5/Qt5FontFace.cxx)Stephan Bergmann
Change-Id: Ie758f8677ac9fdd573484c467b7f021cd055adb6
2018-08-20IsBetterMatch just uses FontSelectPatternAttributesCaolán McNamara
Change-Id: I5d0ca9059bc5717b345332e18ef983db982a2966 Reviewed-on: https://gerrit.libreoffice.org/59316 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-11drop PhysicalFontFace::CloneNoel Grandin
since we are now holding these via reference counting, no need to clone them Change-Id: I7b0bd86f4a5bca428f7dcd989f838a9aa0c7e179 Reviewed-on: https://gerrit.libreoffice.org/55427 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08hold LogicalFontInstance with rtl::ReferenceNoel Grandin
instead of manual reference counting. Also the releasing of not-currently-in-use LogicalFontInstance objects from the cache is made less aggressive - we now only flush entries until we have less than CACHE_SIZE instances, instead of flushing the whole cache. Change-Id: Ib235b132776b5f09ae8ae93a933c2eebe5fa9610 Reviewed-on: https://gerrit.libreoffice.org/55384 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-07manage PhysicalFontFace by rtl::ReferenceNoel Grandin
Change-Id: I8f66b5afb066fe83abb83c56ebde6f21197f894b Reviewed-on: https://gerrit.libreoffice.org/55333 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-07Move PhysicalFontFace member of FontSelectPatternJan-Marek Glogowski
A FontSelectPattern describes a general font request. It can be used to find the best matching LogicalFontInstance. The instance will be created based on a PhysicalFontFace, which is really a factory since commit 8b700794b2746070814e9ff416ecd7bbb1c902e7. Following this workflow, this moves the PhysicalFontFace pointer to the instance and makes it constant. Which leaves some special symbol font handling code in the hash and instance lookup code path. It used to query the font face directly from the instance. I'm not sure of the correct handling. The related commits where made to fix #i89002#, which has an attached test document. 1. commit 849f618270da313f9339dda29a9f35938434c91d 2. commit 8c9823d311fdf8092cc75873e4565325d204a658 The document is as broken as it was before the patch. The symbol substitution still works, but the 'Q's are missing when displaying a symbol font. I also don't understand all the reinterpret_casts for fake font ids. I guess this was used to prevent the crashes I see, where a PhysicalFontFace referenced in a valid LogicalFontInstance is freed and a later FontId check in the GlyphCache crashes. So this now checks for a valid cache instead. Change-Id: If8ee5a6288e66cfa4c419289fbdd5b5da128c6ea Reviewed-on: https://gerrit.libreoffice.org/47279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2017-12-15Protect all LogicalFontInstance constructorsJan-Marek Glogowski
This way LogicalFontInstance can just be constructed by a PhysicalFontFace based factory. The patch also drops the wrong "Java logical font" comment added by commit 125cdf3404e60cf78f2a5547e9a06ce994df5c8e. Change-Id: Ibd5d7da0c3a65dbfa2c8ae6b05cf616d39b749f2 Reviewed-on: https://gerrit.libreoffice.org/46475 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2017-10-30Constify some VCL interface functionsJan-Marek Glogowski
This drops the bPaintEnd optimization for vertical and horizontal lines on Windows, where Polyline and LineTo exclude painting the last pixel of the line. Instead we just always set the last pixel. It also merges the various "SetPixel" call sites into a common drawPixelImpl function. Change-Id: I01cc3c01c908ba74f7978fa90eaaf8d88f923ae3 Reviewed-on: https://gerrit.libreoffice.org/43939 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
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-02-09Formatting changes across all modulesChris Sherlock
+ Removed comment cruft + Tab formatting in number of files + Some commented out code removed + Tab characters replaced with spaces + Newline cleanup in quite a few files + Tweak header guard #endifs Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc Reviewed-on: https://gerrit.libreoffice.org/22221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-10vcl: promote ImplFontAttributes to FontAttributesChris Sherlock
ImplFontAttributes is no longer merely a pImpl (or "compilation firewall", take your pick) but is a fully fledged class in its own right that is used by a number of classes, including FontSelectPattern, LogicalFontInstance and PhysicalFontFace. Thus I'm "promoting" the use of this class in the codebase. Change-Id: I26866080a64796978d1c25efbcd16e3e6f94aaa5 Reviewed-on: https://gerrit.libreoffice.org/21305 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-08vcl: change ImplFontEntry to LogicalFontInstanceChris Sherlock
There is a TODO in the code that suggests to do this, when I looked at the collaboration diagram on Doxygen things made a LOT more sense. Change-Id: If335498bb70872ffa5738cc5c17660faec84c35e Reviewed-on: https://gerrit.libreoffice.org/21257 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-07vcl: rename outfont.hxx to fontentry.hxxChris Sherlock
Change-Id: I174a7a87d68958d0a5dd7c3e0f35294f0d020eb1 Reviewed-on: https://gerrit.libreoffice.org/21189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-07vcl: split more font classes from outfont.hxxChris Sherlock
Change-Id: Ifa10c3b954dd245ff8357b790b59316b3fb111a9
2016-01-03vcl: split out ImplFontAttributes into own headerChris Sherlock
Change-Id: I74cde57e328047ac149593c5bb065d7a6066941d Reviewed-on: https://gerrit.libreoffice.org/21056 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-01vcl: remove poor-man's RTTI in PhysicalFontFaceChris Sherlock
The *only* things relying on the in-built magic number are PDFFontCache and PDFWriterImpl. PDFWriterImpl::emitBuiltinFont has as its first parameter a const PhysicalFontFace*, but this is only called upon by PDFWriterImpl::emitFonts, which instantiates an ImplPdfBuiltinFontData object from a built-in font map... so basically it is always guaranteed to get a ImplPdfBuiltinFontData object. ImplPdfBuiltinFontData derives from PhysicalFontFace, so to prevent the need to check the class being used is a ImplPdfBuiltinFontData, just make emitBuiltinFont require as it's first parameter ImplPdfBuiltinFontData! Unfortunately, we can't get around RTTI completely, because PDFFontCache::FontIdentifier requires a way of distinguishing between two different PhysicalFontFaces... Change-Id: I74c8cd294580bbecd12dd2427ac405f97a7e7f7e Reviewed-on: https://gerrit.libreoffice.org/21030 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-02Revert "vcl: Get rid of FontMatchStatus structure"Chris Sherlock
This reverts commit 60676b3b376d5f3f6fb29fa68c34117c2149bbec. The FontMapStatus structure is passed as a reference to save the search state outside of the search loop in PhysicalFontFamily::FindBestFontFace. This *looked* like it would be an easy win, evidently not! Back to the drawing board. Change-Id: Icc7078543e50bc34221127d8df055f056e249cdb
2016-01-01vcl: End friendshipChris Sherlock
Always wanted to write a commit that said this. Change-Id: I52f6a188e2d115eef9a1e3f702ed127fea3ebb4c
2016-01-01vcl: Get rid of FontMatchStatus structureChris Sherlock
It's used exactly once, as a parameter of PhysicalFontFace::IsBetterMatch()'s function signature. That parameter only acts as input, so I think this is a case of YAGNI creeping into the code, thus I'm getting rid of it. Change-Id: Ic5e24f484d652ba2196e512795d0d27f4239df30
2015-12-31vcl: merge ImplDevFontAttributes with ImplFontAttributesChris Sherlock
ImplFontAttributes handles device independent data, whilst ImplDevFontAttributes handles device dependent data. However, there is no real reason for the divide in classes, and in fact I'm not at all a fan of using a pImpl directly - sort of defeats the purpose of having one! Change-Id: I2db22727e3479b14e3bc37dfad9136703bbdeb13 Reviewed-on: https://gerrit.libreoffice.org/21018 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-12-25vcl: note about physical and logical fontsChris Sherlock
Change-Id: I8e767ed61b93e1099f6e10ef77e813ba4e8d22db
2015-12-25vcl: PhysicalFontFamily now handles it's own list of font facesChris Sherlock
The internal linked list has now been removed from PhysicalFontFace and a std::vector is used within PhysicalFontFamily, which is the class that actually should be managing the storage of font face instances. Change-Id: I4f0c5f8831c3f3b60b81b814ca8ea8e2f2e1e7a9 Reviewed-on: https://gerrit.libreoffice.org/20922 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-07-10loplugin:unusedmethods vcl(part2)Noel Grandin
Change-Id: I12356b3fdce68282a30cae2b270b02e46558860a Reviewed-on: https://gerrit.libreoffice.org/16847 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-26followup code removal after changing virtual methods to non-virtualNoel Grandin
This cleanups up indentation and removes dead classes. This is a followup patch to commit 272b1dd55797aacf511fb4342b0054e3697243f6 "new loplugin: change virtual methods to non-virtual" Change-Id: I1c2139589cf8cb23bb9808defe22c51039d38de1
2015-01-26new loplugin: change virtual methods to non-virtualNoel Grandin
Where we can prove that the virtual method is never overriden. In the case of pure-virtual methods, we remove the method entirely. Sometimes this leads to entire methods and fields being eliminated. Change-Id: I138ef81c95f115dbd8c023a83cfc7e9d5d6d14ae
2014-06-06fixincludeguards: fix include guardsThomas Arnhold
Change-Id: Ie6e8d4272b0b1d0d2ce93bcbc2e818a9eac1a56b Reviewed-on: https://gerrit.libreoffice.org/9629 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-04-02Kill superfluous vertical whitespaceTor Lillqvist
Change-Id: I81ce8fd7022bf283db668705efdfb0666f87bde9
2014-03-20cosmetic: split PhysicalFontFace class it its own source/headerNorbert Thiebaud
oudev,2,3,4,5,6 are a dumping ground for a lot of things chipping at it one class at the time... organize the #include of the impacted source while at it. Change-Id: I57bbb1f9e3c6b2ac6b3ca127e5976bf16f3e3cf8