1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef OOX_DRAWINGNML_TEXTFONT_HXX 25 #define OOX_DRAWINGNML_TEXTFONT_HXX 26 27 #include <rtl/ustring.hxx> 28 29 namespace oox { class AttributeList; } 30 namespace oox { namespace core { class XmlFilterBase; } } 31 32 namespace oox { 33 namespace drawingml { 34 35 // ============================================================================ 36 37 /** carries a CT_TextFont*/ 38 class TextFont 39 { 40 public: 41 explicit TextFont(); 42 43 /** Sets attributes from the passed attribute list. */ 44 void setAttributes( const AttributeList& rAttribs ); 45 46 /** Overwrites this text font with the passed text font, if it is used. */ 47 void assignIfUsed( const TextFont& rTextFont ); 48 49 /** Returns the font name, pitch, and family; tries to resolve theme 50 placeholder names, e.g. '+mj-lt' for the major latin theme font. */ 51 bool getFontData( 52 ::rtl::OUString& rFontName, 53 sal_Int16 rnFontPitch, 54 sal_Int16& rnFontFamily, 55 const ::oox::core::XmlFilterBase& rFilter ) const; 56 57 private: 58 bool implGetFontData( 59 ::rtl::OUString& rFontName, 60 sal_Int16 rnFontPitch, 61 sal_Int16& rnFontFamily ) const; 62 63 private: 64 ::rtl::OUString maTypeface; 65 ::rtl::OUString maPanose; 66 sal_Int32 mnPitch; 67 sal_Int32 mnCharset; 68 }; 69 70 // ============================================================================ 71 72 } // namespace drawingml 73 } // namespace oox 74 75 #endif 76 77