diff options
-rw-r--r-- | include/vcl/font.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/impfont.hxx | 11 | ||||
-rw-r--r-- | vcl/qa/cppunit/font.cxx | 13 | ||||
-rw-r--r-- | vcl/source/font/font.cxx | 4 |
4 files changed, 25 insertions, 5 deletions
diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index 8cb34b6833e3..498c6a56ebe8 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -87,6 +87,7 @@ public: bool IsBuiltInFont() const; bool CanEmbed() const; + bool CanSubset() const; void SetQuality(int); void IncreaseQualityBy(int); @@ -94,6 +95,7 @@ public: void SetBuiltInFontFlag(bool); void SetEmbeddableFlag(bool); + void SetSubsettableFlag(bool); // setting the color on the font is obsolete, the only remaining // valid use is for keeping backward compatibility with old MetaFiles diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index cc87b2e0c14a..e522c287666d 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -37,8 +37,8 @@ public: // device independent font functions const OUString& GetFamilyName() const { return maFamilyName; } - FontFamily GetFamilyType() { if(meFamily==FAMILY_DONTKNOW) AskConfig(); return meFamily; } - FontFamily GetFamilyTypeNoAsk() const { return meFamily; } + FontFamily GetFamilyType() { if(meFamily==FAMILY_DONTKNOW) AskConfig(); return meFamily; } + FontFamily GetFamilyTypeNoAsk() const { return meFamily; } const OUString& GetStyleName() const { return maStyleName; } FontWeight GetWeight() { if(meWeight==WEIGHT_DONTKNOW) AskConfig(); return meWeight; } @@ -75,7 +75,7 @@ public: bool IsBuiltInFont() const { return mbDevice; } bool CanEmbed() const { return mbEmbeddable; } - /* Missing function: bool CanSubSet() const; */ + bool CanSubset() const { return mbSubsettable; } /* Missing function: bool CanRotate() const; */ /* Missing function: bool HasMapNames() const; */ @@ -84,7 +84,7 @@ public: void SetBuiltInFontFlag( bool bIsBuiltInFont ) { mbDevice = bIsBuiltInFont; } void SetEmbeddableFlag( bool bEmbeddable ) { mbEmbeddable = bEmbeddable; } - /* Missing function: void SetSettableFlag( bool ); */ + void SetSubsettableFlag( bool bSubsettable ) { mbSubsettable = bSubsettable; } /* missing function: void SetOrientationFlag( bool ); */ bool operator==( const ImplFont& ) const; @@ -123,7 +123,8 @@ private: mbVertical:1, mbTransparent:1, // compatibility, now on output device mbDevice:1, - mbEmbeddable:1; + mbEmbeddable:1, + mbSubsettable:1; int mnQuality; friend SvStream& ReadImplFont( SvStream& rIStm, ImplFont& ); diff --git a/vcl/qa/cppunit/font.cxx b/vcl/qa/cppunit/font.cxx index a57395c05d76..656d08917fb8 100644 --- a/vcl/qa/cppunit/font.cxx +++ b/vcl/qa/cppunit/font.cxx @@ -29,6 +29,7 @@ public: void testQuality(); void testBuiltInFontFlag(); void testEmbeddableFontFlag(); + void testSubsettableFontFlag(); void testSymbolFlagAndCharSet(); CPPUNIT_TEST_SUITE(VclFontTest); @@ -40,6 +41,7 @@ public: CPPUNIT_TEST(testQuality); CPPUNIT_TEST(testBuiltInFontFlag); CPPUNIT_TEST(testEmbeddableFontFlag); + CPPUNIT_TEST(testSubsettableFontFlag); CPPUNIT_TEST(testSymbolFlagAndCharSet); CPPUNIT_TEST_SUITE_END(); }; @@ -133,6 +135,17 @@ void VclFontTest::testEmbeddableFontFlag() CPPUNIT_ASSERT_EQUAL( true, aFont.CanEmbed() ); } + +void VclFontTest::testSubsettableFontFlag() +{ + vcl::Font aFont; + + CPPUNIT_ASSERT_EQUAL( false, aFont.CanSubset() ); + + aFont.SetSubsettableFlag( true ); + CPPUNIT_ASSERT_EQUAL( true, aFont.CanSubset() ); +} + void VclFontTest::testSymbolFlagAndCharSet() { // default constructor should set scalable flag to false diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index aa85d052cb25..62f35bdbf7fc 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -817,6 +817,8 @@ bool Font::IsBuiltInFont() const { return mpImplFont->IsBuiltInFont(); } void Font::SetBuiltInFontFlag( bool bIsBuiltInFontFlag ) { mpImplFont->SetBuiltInFontFlag( bIsBuiltInFontFlag ); } bool Font::CanEmbed() const { return mpImplFont->CanEmbed(); } void Font::SetEmbeddableFlag( bool bEmbeddable ) { mpImplFont->SetEmbeddableFlag( bEmbeddable ); } +bool Font::CanSubset() const { return mpImplFont->CanSubset(); } +void Font::SetSubsettableFlag( bool bSubsettable ) { mpImplFont->SetSubsettableFlag( bSubsettable ); } bool Font::IsOutline() const { return mpImplFont->mbOutline; } bool Font::IsShadow() const { return mpImplFont->mbShadow; } FontRelief Font::GetRelief() const { return mpImplFont->meRelief; } @@ -858,6 +860,7 @@ ImplFont::ImplFont() : mbTransparent( true ), mbDevice( false ), mbEmbeddable( false ), + mbSubsettable( false ), mnQuality( 0 ) {} @@ -893,6 +896,7 @@ ImplFont::ImplFont( const ImplFont& rImplFont ) : mbTransparent( rImplFont.mbTransparent ), mbDevice( rImplFont.mbDevice ), mbEmbeddable( false ), + mbSubsettable( false ), mnQuality( rImplFont.mnQuality ) {} |