editeng/inc/editattr.hxx | 10 +++ editeng/source/editeng/editattr.cxx | 14 ++++ editeng/source/editeng/editdoc.cxx | 29 +++++++++ editeng/source/editeng/eerdll.cxx | 2 editeng/source/items/textitem.cxx | 30 +++++++++ include/editeng/editids.hrc | 2 include/editeng/editrids.hrc | 2 include/editeng/eeitem.hxx | 4 - include/editeng/opticalsizingitem.hxx | 37 ++++++++++++ include/svl/poolitem.hxx | 1 include/xmloff/xmltoken.hxx | 1 include/xmloff/xmltypes.hxx | 2 schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | 12 +++ xmloff/inc/xmlprop.hxx | 1 xmloff/source/core/xmltoken.cxx | 1 xmloff/source/text/txtprhdl.cxx | 4 + xmloff/source/text/txtprmap.cxx | 2 xmloff/source/token/tokens.txt | 1 18 files changed, 153 insertions(+), 2 deletions(-)
New commits: commit 331e2c3b89d4f5fe53822489aab463a81fb19810 Author: Khaled Hosny <[email protected]> AuthorDate: Mon Mar 2 02:02:21 2026 +0200 Commit: Khaled Hosny <[email protected]> CommitDate: Mon Mar 2 21:45:18 2026 +0100 tdf#153368: Support optical size for variable fonts, part 3 Add loext:font-optical-sizing attribute with two values, "auto" and "none", modeled after CSS font-optical-sizing: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-optical-sizing Change-Id: I05396f084dc81d0a797be0e7c0cd57991a6876e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200502 Tested-by: Jenkins Reviewed-by: Khaled Hosny <[email protected]> diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 18d855cb5a6d..79e096c4c2b2 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -877,6 +877,7 @@ namespace xmloff::token { XML_FONT_NAME, XML_FONT_NAME_ASIAN, XML_FONT_NAME_COMPLEX, + XML_FONT_OPTICAL_SIZING, XML_FONT_PITCH, XML_FONT_PITCH_ASIAN, XML_FONT_PITCH_COMPLEX, diff --git a/include/xmloff/xmltypes.hxx b/include/xmloff/xmltypes.hxx index 69b00fa035c8..e734251d0a84 100644 --- a/include/xmloff/xmltypes.hxx +++ b/include/xmloff/xmltypes.hxx @@ -303,6 +303,8 @@ #define XML_TYPE_TEXT_SCRIPT_TYPE (XML_TEXT_TYPES_START + 134) +#define XML_TYPE_TEXT_FONT_OPTICAL_SIZING (XML_TEXT_TYPES_START + 135) + #endif // INCLUDED_XMLOFF_XMLTYPES_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng b/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng index a3c7eb909c84..5faa53a792af 100644 --- a/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng +++ b/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng @@ -4009,6 +4009,18 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. </rng:optional> </rng:define> + <!-- TODO no proposal --> + <rng:define name="style-text-properties-attlist" combine="interleave"> + <rng:optional> + <rng:attribute name="loext:font-optical-sizing"> + <rng:choice> + <rng:value>auto</rng:value> + <rng:value>none</rng:value> + </rng:choice> + </rng:attribute> + </rng:optional> + </rng:define> + <!-- TODO no proposal --> <rng:define name="style-graphic-properties-elements" combine="interleave"> <rng:optional> diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx index c63ec8b44414..c73d8372f691 100644 --- a/xmloff/inc/xmlprop.hxx +++ b/xmloff/inc/xmlprop.hxx @@ -98,6 +98,7 @@ inline constexpr OUString PROP_CharLocale = u"CharLocale"_ustr; inline constexpr OUString PROP_CharLocaleAsian = u"CharLocaleAsian"_ustr; inline constexpr OUString PROP_CharLocaleComplex = u"CharLocaleComplex"_ustr; inline constexpr OUString PROP_CharNoHyphenation = u"CharNoHyphenation"_ustr; +inline constexpr OUString PROP_CharOpticalSizing = u"CharOpticalSizing"_ustr; inline constexpr OUString PROP_CharOverline = u"CharOverline"_ustr; inline constexpr OUString PROP_CharOverlineColor = u"CharOverlineColor"_ustr; inline constexpr OUString PROP_CharOverlineHasColor = u"CharOverlineHasColor"_ustr; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index a6b9c680eb3a..d904495e4fb5 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -889,6 +889,7 @@ namespace xmloff::token { TOKEN( "font-name", XML_FONT_NAME ), TOKEN( "font-name-asian", XML_FONT_NAME_ASIAN ), TOKEN( "font-name-complex", XML_FONT_NAME_COMPLEX ), + TOKEN( "font-optical-sizing", XML_FONT_OPTICAL_SIZING ), TOKEN( "font-pitch", XML_FONT_PITCH ), TOKEN( "font-pitch-asian", XML_FONT_PITCH_ASIAN ), TOKEN( "font-pitch-complex", XML_FONT_PITCH_COMPLEX ), diff --git a/xmloff/source/text/txtprhdl.cxx b/xmloff/source/text/txtprhdl.cxx index 7c02820dd5ed..c411fa5be5e3 100644 --- a/xmloff/source/text/txtprhdl.cxx +++ b/xmloff/source/text/txtprhdl.cxx @@ -1393,6 +1393,10 @@ static const XMLPropertyHandler *GetPropertyHandler case XML_TYPE_TEXT_FONT_RELIEF: pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID ); break; + case XML_TYPE_TEXT_FONT_OPTICAL_SIZING: + pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_AUTO ), + GetXMLToken( XML_NONE ) ); + break; case XML_TYPE_TEXT_ROTATION_ANGLE: pHdl = new XMLTextRotationAnglePropHdl_Impl; break; diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 0374aa514644..7aaeba0f6aa6 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -253,6 +253,7 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] = MT_E( PROP_CharScaleWidth, XML_NAMESPACE_STYLE, XML_TEXT_SCALE, XML_TYPE_PERCENT16, 0 ), //RES_CHRATR_RELIEF MT_E( PROP_CharRelief, XML_NAMESPACE_STYLE, XML_FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF, 0 ), + MAP_EXT( PROP_CharOpticalSizing, XML_NAMESPACE_LO_EXT, XML_FONT_OPTICAL_SIZING, XML_TYPE_TEXT_FONT_OPTICAL_SIZING | XML_TYPE_PROP_TEXT, 0 ), // RES_CHRATR_HIDDEN MT_E( PROP_CharHidden, XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TYPE_TEXT_HIDDEN_AS_DISPLAY|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_TEXT_DISPLAY ), // RES_CHRATR_OVERLINE @@ -639,6 +640,7 @@ XMLPropertyMapEntry constexpr aXMLTextPropMap[] = MT_E( PROP_, XML_NAMESPACE_STYLE, XML_TEXT_COMBINE, XML_TYPE_TEXT_COMBINE_CHARACTERS|MID_FLAG_NO_PROPERTY, CTF_COMBINED_CHARACTERS_FIELD ), //RES_CHRATR_RELIEF MT_E( PROP_CharRelief, XML_NAMESPACE_STYLE, XML_FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF, 0 ), + MAP_EXT( PROP_CharOpticalSizing, XML_NAMESPACE_LO_EXT, XML_FONT_OPTICAL_SIZING, XML_TYPE_TEXT_FONT_OPTICAL_SIZING | XML_TYPE_PROP_TEXT, 0 ), // RES_CHRATR_HIDDEN MT_E( PROP_CharHidden, XML_NAMESPACE_TEXT, XML_DISPLAY, XML_TYPE_TEXT_HIDDEN_AS_DISPLAY|MID_FLAG_SPECIAL_ITEM_IMPORT, CTF_TEXT_DISPLAY ), // RES_CHRATR_OVERLINE diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index f268760695f5..9735eea566c5 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -794,6 +794,7 @@ font-kerning font-name font-name-asian font-name-complex +font-optical-sizing font-pitch font-pitch-asian font-pitch-complex commit d128bdf1feadd167485f819a582af533cfde6523 Author: Khaled Hosny <[email protected]> AuthorDate: Mon Mar 2 02:02:19 2026 +0200 Commit: Khaled Hosny <[email protected]> CommitDate: Mon Mar 2 21:45:06 2026 +0100 tdf#153368: Support optical size for variable fonts, part 2 Add SvxOpticalSizingItem and EditEngine plumbing. Mostly mindlessly copying stuff here. Lets hope for the best. Change-Id: Idf0b062ff955fa35bd04c8e69c103e15887932f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200501 Tested-by: Jenkins Reviewed-by: Khaled Hosny <[email protected]> diff --git a/editeng/inc/editattr.hxx b/editeng/inc/editattr.hxx index 210684d90f7f..8f9d2aeba0a6 100644 --- a/editeng/inc/editattr.hxx +++ b/editeng/inc/editattr.hxx @@ -394,6 +394,16 @@ public: }; + +class EditCharAttribOpticalSizing final : public EditCharAttrib +{ +public: + EditCharAttribOpticalSizing(SfxItemPool&, const SfxPoolItem&, sal_Int32 nStart, sal_Int32 nEnd); + + virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ) override; +}; + + class EditCharAttribGrabBag final : public EditCharAttrib { public: diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 06ac807367af..e657acfff90b 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -39,6 +39,7 @@ #include <editeng/emphasismarkitem.hxx> #include <editeng/charreliefitem.hxx> #include <editeng/cmapitem.hxx> +#include <editeng/opticalsizingitem.hxx> #include <editattr.hxx> @@ -465,6 +466,19 @@ void EditCharAttribRelief::SetFont( SvxFont& rFont, OutputDevice* ) } + +EditCharAttribOpticalSizing::EditCharAttribOpticalSizing(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) +: EditCharAttrib(rPool, rItem, _nStart, _nEnd) +{ + assert(rItem.Which() == EE_CHAR_OPTICALSIZING); +} + +void EditCharAttribOpticalSizing::SetFont( SvxFont& rFont, OutputDevice* ) +{ + rFont.SetOpticalSizing( static_cast<const SvxOpticalSizingItem*>(GetItem())->GetValue() ); +} + + EditCharAttribGrabBag::EditCharAttribGrabBag(SfxItemPool& rPool, const SfxPoolItem& rItem, sal_Int32 _nStart, sal_Int32 _nEnd) : EditCharAttrib(rPool, rItem, _nStart, _nEnd) { diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 5b88a6095575..8112243c9f5c 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -45,6 +45,7 @@ #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> #include <editeng/lspcitem.hxx> +#include <editeng/opticalsizingitem.hxx> #if ENABLE_YRS #include <editeng/frmdiritem.hxx> #include <editeng/hngpnctitem.hxx> @@ -321,6 +322,11 @@ EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sa return new EditCharAttribScriptHint(rPool, rAttr, nS, nE); } break; + case EE_CHAR_OPTICALSIZING: + { + return new EditCharAttribOpticalSizing(rPool, rAttr, nS, nE ); + } + break; default: break; } @@ -1224,7 +1230,13 @@ void YrsInsertAttribImplImpl(YrsWrite const& yw, SfxPoolItem const& rItm, // these aren't editable? //constexpr TypedWhichId<SvXMLAttrContainerItem> EE_CHAR_XMLATTRIBS (EE_CHAR_START+27); //constexpr TypedWhichId<SfxGrabBagItem> EE_CHAR_GRABBAG (EE_CHAR_START+30); - + case EE_CHAR_OPTICALSIZING: + { + SvxOpticalSizingItem const& rItem{static_cast<SvxOpticalSizingItem const&>(rItm)}; + attr = yinput_bool(rItem.GetValue() ? Y_TRUE : Y_FALSE); + attrName = "EE_CHAR_OPTICALSIZING"; + break; + } default: assert(false); } @@ -1581,6 +1593,8 @@ char const* YrsWhichToAttrName(sal_Int16 const nWhich) return "EE_PARA_JUST_METHOD"; case EE_PARA_VER_JUST: return "EE_PARA_VER_JUST"; + case EE_CHAR_OPTICALSIZING: + return "EE_CHAR_OPTICALSIZING"; default: assert(false); abort(); @@ -1823,6 +1837,10 @@ void YrsImplInsertAttr(SfxItemSet & rSet, ::std::vector<sal_uInt16> *const pRemo { nWhich = EE_PARA_VER_JUST; } + else if (strcmp(pKey, "EE_CHAR_OPTICALSIZING") == 0) + { + nWhich = EE_CHAR_OPTICALSIZING; + } else if (pKey[0] == 'E' && pKey[1] == 'E' && pKey[2] == '_') { abort(); @@ -2454,6 +2472,13 @@ void YrsImplInsertAttr(SfxItemSet & rSet, ::std::vector<sal_uInt16> *const pRemo rSet.Put(item); break; } + case EE_CHAR_OPTICALSIZING: + { + yvalidate(rValue.tag == Y_JSON_BOOL); + SvxOpticalSizingItem const item{rValue.value.flag == Y_TRUE, nWhich}; + rSet.Put(item); + break; + } default: assert(false); @@ -3280,6 +3305,8 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S rFont.SetEmphasisMark( rSet.Get( EE_CHAR_EMPHASISMARK ).GetEmphasisMark() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_RELIEF ) == SfxItemState::SET ) ) rFont.SetRelief( rSet.Get( EE_CHAR_RELIEF ).GetValue() ); + if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_OPTICALSIZING ) == SfxItemState::SET ) ) + rFont.SetOpticalSizing( rSet.Get( EE_CHAR_OPTICALSIZING ).GetValue() ); // Operator == compares the individual members of the font if the impl pointer is // not equal. If all members are the same, this assignment makes diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index c064110c136b..5c7069fe1174 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -67,6 +67,7 @@ #include <editeng/xmlcnitm.hxx> #include <editeng/forbiddencharacterstable.hxx> #include <editeng/justifyitem.hxx> +#include <editeng/opticalsizingitem.hxx> #include <tools/mapunit.hxx> #include <tools/lazydelete.hxx> #include <svl/itempool.hxx> @@ -160,6 +161,7 @@ ItemInfoPackage& getItemInfoPackageEditEngine() { EE_CHAR_BKGCOLOR, new SvxColorItem( COL_AUTO, EE_CHAR_BKGCOLOR ), SID_ATTR_CHAR_BACK_COLOR, SFX_ITEMINFOFLAG_NONE }, { EE_CHAR_RUBY, new SvxRubyItem( EE_CHAR_RUBY ), SID_ATTR_CHAR_RUBY, SFX_ITEMINFOFLAG_NONE }, { EE_CHAR_SCRIPT_HINT, new SvxScriptHintItem( EE_CHAR_SCRIPT_HINT ), SID_ATTR_CHAR_SCRIPT_HINT, SFX_ITEMINFOFLAG_NONE }, + { EE_CHAR_OPTICALSIZING, new SvxOpticalSizingItem( false, EE_CHAR_OPTICALSIZING ), SID_ATTR_CHAR_OPTICAL_SIZING, SFX_ITEMINFOFLAG_NONE }, { EE_FEATURE_TAB, new SfxVoidItem( EE_FEATURE_TAB ), 0, SFX_ITEMINFOFLAG_NONE }, { EE_FEATURE_LINEBR, new SfxVoidItem( EE_FEATURE_LINEBR ), 0, SFX_ITEMINFOFLAG_NONE }, { EE_FEATURE_NOTCONV, new SvxColorItem( COL_RED, EE_FEATURE_NOTCONV ), SID_ATTR_CHAR_CHARSETCOLOR, SFX_ITEMINFOFLAG_NONE }, diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 0714418d99ab..49927a9868e8 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -82,6 +82,7 @@ #include <editeng/itemtype.hxx> #include <editeng/scripthintitem.hxx> #include <editeng/eerdll.hxx> +#include <editeng/opticalsizingitem.hxx> #include <docmodel/color/ComplexColorJSON.hxx> #include <docmodel/uno/UnoComplexColor.hxx> #include <docmodel/color/ComplexColor.hxx> @@ -110,6 +111,7 @@ SfxPoolItem* SvxEmphasisMarkItem::CreateDefault() {return new SvxEmphasisMarkIte SfxPoolItem* SvxCharRotateItem::CreateDefault() {return new SvxCharRotateItem(0_deg10, false, TypedWhichId<SvxCharRotateItem>(0));} SfxPoolItem* SvxCharScaleWidthItem::CreateDefault() {return new SvxCharScaleWidthItem(100, TypedWhichId<SvxCharScaleWidthItem>(0));} SfxPoolItem* SvxCharReliefItem::CreateDefault() {return new SvxCharReliefItem(FontRelief::NONE, 0);} +SfxPoolItem* SvxOpticalSizingItem::CreateDefault() {return new SvxOpticalSizingItem(false, 0);} // class SvxFontListItem ------------------------------------------------- @@ -3023,4 +3025,32 @@ void SvxRsidItem::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterEndElement(pWriter); } +// class SvxOpticalSizingItem -------------------------------------------- + +SvxOpticalSizingItem::SvxOpticalSizingItem( const bool bOpticalSizing, const sal_uInt16 nId ) : + SfxBoolItem( nId, bOpticalSizing ) +{ +} + +SvxOpticalSizingItem* SvxOpticalSizingItem::Clone( SfxItemPool * ) const +{ + return new SvxOpticalSizingItem( *this ); +} + +bool SvxOpticalSizingItem::GetPresentation +( + SfxItemPresentation /*ePres*/, + MapUnit /*eCoreUnit*/, + MapUnit /*ePresUnit*/, + OUString& rText, const IntlWrapper& /*rIntl*/ +) const +{ + TranslateId pId = RID_SVXITEMS_OPTICALSIZING_FALSE; + + if ( GetValue() ) + pId = RID_SVXITEMS_OPTICALSIZING_TRUE; + rText = EditResId(pId); + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc index c431aeb6760f..d49d486b5e71 100644 --- a/include/editeng/editids.hrc +++ b/include/editeng/editids.hrc @@ -68,6 +68,7 @@ class SvxWidowsItem; class SvxWordLineModeItem; class SvxScriptHintItem; class SvxFontListItem; +class SvxOpticalSizingItem; /* These SID_SVX_START entries came from include/svx/svxids.hrc, avoid @@ -188,6 +189,7 @@ class SvxFontListItem; #define SID_ATTR_PARA_GRABBAG TypedWhichId<SfxGrabBagItem>( SID_EDIT_START + 78 ) #define SID_ATTR_PARA_ADJUST_START ( SID_EDIT_START + 79 ) #define SID_ATTR_PARA_ADJUST_END ( SID_EDIT_START + 80 ) +#define SID_ATTR_CHAR_OPTICAL_SIZING TypedWhichId<SvxOpticalSizingItem>( SID_EDIT_START + 81 ) #if 95 > (SID_EDIT_END-SID_EDIT_START) diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc index 0a25d1f14994..9d8105e62547 100644 --- a/include/editeng/editrids.hrc +++ b/include/editeng/editrids.hrc @@ -185,6 +185,8 @@ #define RID_SVXITEMS_BLINK_FALSE NC_("RID_SVXITEMS_BLINK_FALSE", "Not Blinking") #define RID_SVXITEMS_AUTOKERN_TRUE NC_("RID_SVXITEMS_AUTOKERN_TRUE", "Pair Kerning") #define RID_SVXITEMS_AUTOKERN_FALSE NC_("RID_SVXITEMS_AUTOKERN_FALSE", "No pair kerning") +#define RID_SVXITEMS_OPTICALSIZING_TRUE NC_("RID_SVXITEMS_OPTICALSIZING_TRUE", "Optical Sizing") +#define RID_SVXITEMS_OPTICALSIZING_FALSE NC_("RID_SVXITEMS_OPTICALSIZING_FALSE", "No optical sizing") #define RID_SVXITEMS_NOHYPHENATION_TRUE NC_("RID_SVXITEMS_NOHYPHENATION_TRUE", "No hyphenation") #define RID_SVXITEMS_WORDLINE_TRUE NC_("RID_SVXITEMS_WORDLINE_TRUE", "Individual words") #define RID_SVXITEMS_WORDLINE_FALSE NC_("RID_SVXITEMS_WORDLINE_FALSE", "Not Words Only") diff --git a/include/editeng/eeitem.hxx b/include/editeng/eeitem.hxx index 89b85207a24a..f9ffe91fea14 100644 --- a/include/editeng/eeitem.hxx +++ b/include/editeng/eeitem.hxx @@ -63,6 +63,7 @@ class SvxJustifyMethodItem; class SvxVerJustifyItem; class SvxRubyItem; class SvxScriptHintItem; +class SvxOpticalSizingItem; /* * NOTE: Changes in this file will probably require @@ -133,8 +134,9 @@ inline constexpr TypedWhichId<SfxGrabBagItem> EE_CHAR_GRABBAG (EE inline constexpr TypedWhichId<SvxColorItem> EE_CHAR_BKGCOLOR (EE_CHAR_START+31); inline constexpr TypedWhichId<SvxRubyItem> EE_CHAR_RUBY (EE_CHAR_START+32); inline constexpr TypedWhichId<SvxScriptHintItem> EE_CHAR_SCRIPT_HINT (EE_CHAR_START+33); +inline constexpr TypedWhichId<SvxOpticalSizingItem> EE_CHAR_OPTICALSIZING (EE_CHAR_START+34); -inline constexpr sal_uInt16 EE_CHAR_END (EE_CHAR_START + 33); +inline constexpr sal_uInt16 EE_CHAR_END (EE_CHAR_START + 34); inline constexpr sal_uInt16 EE_FEATURE_START (EE_CHAR_END + 1); inline constexpr sal_uInt16 EE_FEATURE_TAB (EE_FEATURE_START + 0); diff --git a/include/editeng/opticalsizingitem.hxx b/include/editeng/opticalsizingitem.hxx new file mode 100644 index 000000000000..7e1dca8f02ff --- /dev/null +++ b/include/editeng/opticalsizingitem.hxx @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include <svl/eitem.hxx> +#include <editeng/editengdllapi.h> + +// class SvxOpticalSizingItem --------------------------------------------- + +/* + [Description] + Attribute for Font Optical Sizing. +*/ + +class EDITENG_DLLPUBLIC SvxOpticalSizingItem final : public SfxBoolItem +{ +public: + static SfxPoolItem* CreateDefault(); + DECLARE_ITEM_TYPE_FUNCTION(SvxOpticalSizingItem) + SvxOpticalSizingItem(const bool bOpticalSizing /*= false*/, const sal_uInt16 nId); + + // "pure virtual Methods" from SfxPoolItem + virtual SvxOpticalSizingItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, + MapUnit ePresMetric, OUString& rText, + const IntlWrapper&) const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index 69bc63eee3e1..ca5a55dd4450 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -311,6 +311,7 @@ enum class SfxItemType : sal_uInt16 SvxAdjustItemType, SvxAutoFrameDirectionItemType, SvxAutoKernItemType, + SvxOpticalSizingItemType, SvxB3DVectorItemType, SvxBitmapListItemType, SvxBlinkItemType,
