LibreOffice Module vcl (master)  1
font/font.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <tools/stream.hxx>
21 #include <tools/vcompat.hxx>
22 #include <tools/gen.hxx>
23 #include <unotools/fontcfg.hxx>
24 #include <unotools/fontdefs.hxx>
25 
26 #include <vcl/font.hxx>
27 
28 #include <impfont.hxx>
29 #include <fontattributes.hxx>
30 #include <sft.hxx>
31 
32 #include <algorithm>
33 #include <string_view>
34 
35 #include <rtl/instance.hxx>
36 #include <vcl/TypeSerializer.hxx>
37 
38 using namespace vcl;
39 
40 namespace
41 {
42  struct theGlobalDefault :
43  public rtl::Static< Font::ImplType, theGlobalDefault > {};
44 }
45 
46 Font::Font() : mpImplFont(theGlobalDefault::get())
47 {
48 }
49 
50 Font::Font( const vcl::Font& rFont ) : mpImplFont( rFont.mpImplFont )
51 {
52 }
53 
54 Font::Font( vcl::Font&& rFont ) noexcept : mpImplFont( std::move(rFont.mpImplFont) )
55 {
56 }
57 
58 Font::Font( const OUString& rFamilyName, const Size& rSize ) : mpImplFont()
59 {
60  mpImplFont->SetFamilyName( rFamilyName );
61  mpImplFont->SetFontSize( rSize );
62 }
63 
64 Font::Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& rSize ) : mpImplFont()
65 {
66  mpImplFont->SetFamilyName( rFamilyName );
67  mpImplFont->SetStyleName( rStyleName );
68  mpImplFont->SetFontSize( rSize );
69 }
70 
71 Font::Font( FontFamily eFamily, const Size& rSize ) : mpImplFont()
72 {
73  mpImplFont->SetFamilyType( eFamily );
74  mpImplFont->SetFontSize( rSize );
75 }
76 
78 {
79 }
80 
81 void Font::SetColor( const Color& rColor )
82 {
83  if (const_cast<const ImplType&>(mpImplFont)->maColor != rColor)
84  {
85  mpImplFont->maColor = rColor;
86  }
87 }
88 
89 void Font::SetFillColor( const Color& rColor )
90 {
91  mpImplFont->maFillColor = rColor;
92  if ( rColor.IsTransparent() )
93  mpImplFont->mbTransparent = true;
94 }
95 
96 void Font::SetTransparent( bool bTransparent )
97 {
98  if (const_cast<const ImplType&>(mpImplFont)->mbTransparent != bTransparent)
99  mpImplFont->mbTransparent = bTransparent;
100 }
101 
103 {
104  if (const_cast<const ImplType&>(mpImplFont)->meAlign != eAlign)
105  mpImplFont->SetAlignment(eAlign);
106 }
107 
108 void Font::SetFamilyName( const OUString& rFamilyName )
109 {
110  mpImplFont->SetFamilyName( rFamilyName );
111 }
112 
113 void Font::SetStyleName( const OUString& rStyleName )
114 {
115  mpImplFont->maStyleName = rStyleName;
116 }
117 
118 void Font::SetFontSize( const Size& rSize )
119 {
120  if (const_cast<const ImplType&>(mpImplFont)->GetFontSize() != rSize)
121  mpImplFont->SetFontSize( rSize );
122 }
123 
125 {
126  if (const_cast<const ImplType&>(mpImplFont)->GetFamilyTypeNoAsk() != eFamily)
127  mpImplFont->SetFamilyType( eFamily );
128 }
129 
130 void Font::SetCharSet( rtl_TextEncoding eCharSet )
131 {
132  if (const_cast<const ImplType&>(mpImplFont)->GetCharSet() != eCharSet)
133  {
134  mpImplFont->SetCharSet( eCharSet );
135 
136  if ( eCharSet == RTL_TEXTENCODING_SYMBOL )
137  mpImplFont->SetSymbolFlag( true );
138  else
139  mpImplFont->SetSymbolFlag( false );
140  }
141 }
142 
143 bool Font::IsSymbolFont() const
144 {
145  return mpImplFont->IsSymbolFont();
146 }
147 
148 void Font::SetSymbolFlag( bool bSymbol )
149 {
150  mpImplFont->SetSymbolFlag( bSymbol );
151 
152  if ( IsSymbolFont() )
153  {
154  mpImplFont->SetCharSet( RTL_TEXTENCODING_SYMBOL );
155  }
156  else
157  {
158  if ( mpImplFont->GetCharSet() == RTL_TEXTENCODING_SYMBOL )
159  mpImplFont->SetCharSet( RTL_TEXTENCODING_DONTKNOW );
160  }
161 }
162 
163 void Font::SetLanguageTag( const LanguageTag& rLanguageTag )
164 {
165  if (const_cast<const ImplType&>(mpImplFont)->maLanguageTag != rLanguageTag)
166  mpImplFont->maLanguageTag = rLanguageTag;
167 }
168 
169 void Font::SetCJKContextLanguageTag( const LanguageTag& rLanguageTag )
170 {
171  if (const_cast<const ImplType&>(mpImplFont)->maCJKLanguageTag != rLanguageTag)
172  mpImplFont->maCJKLanguageTag = rLanguageTag;
173 }
174 
176 {
177  if (const_cast<const ImplType&>(mpImplFont)->maLanguageTag.getLanguageType(false) != eLanguage)
178  mpImplFont->maLanguageTag.reset( eLanguage);
179 }
180 
182 {
183  if (const_cast<const ImplType&>(mpImplFont)->maCJKLanguageTag.getLanguageType(false) != eLanguage)
184  mpImplFont->maCJKLanguageTag.reset( eLanguage);
185 }
186 
187 void Font::SetPitch( FontPitch ePitch )
188 {
189  if (const_cast<const ImplType&>(mpImplFont)->GetPitchNoAsk() != ePitch)
190  mpImplFont->SetPitch( ePitch );
191 }
192 
193 void Font::SetOrientation( Degree10 nOrientation )
194 {
195  if (const_cast<const ImplType&>(mpImplFont)->mnOrientation != nOrientation)
196  mpImplFont->mnOrientation = nOrientation;
197 }
198 
199 void Font::SetVertical( bool bVertical )
200 {
201  if (const_cast<const ImplType&>(mpImplFont)->mbVertical != bVertical)
202  mpImplFont->mbVertical = bVertical;
203 }
204 
206 {
207  if (const_cast<const ImplType&>(mpImplFont)->meKerning != eKerning)
208  mpImplFont->meKerning = eKerning;
209 }
210 
211 bool Font::IsKerning() const
212 {
214 }
215 
217 {
218  if (const_cast<const ImplType&>(mpImplFont)->GetWeightNoAsk() != eWeight)
219  mpImplFont->SetWeight( eWeight );
220 }
221 
223 {
224  if (const_cast<const ImplType&>(mpImplFont)->GetWidthTypeNoAsk() != eWidth)
225  mpImplFont->SetWidthType( eWidth );
226 }
227 
229 {
230  if (const_cast<const ImplType&>(mpImplFont)->GetItalicNoAsk() != eItalic)
231  mpImplFont->SetItalic( eItalic );
232 }
233 
234 void Font::SetOutline( bool bOutline )
235 {
236  if (const_cast<const ImplType&>(mpImplFont)->mbOutline != bOutline)
237  mpImplFont->mbOutline = bOutline;
238 }
239 
240 void Font::SetShadow( bool bShadow )
241 {
242  if (const_cast<const ImplType&>(mpImplFont)->mbShadow != bShadow)
243  mpImplFont->mbShadow = bShadow;
244 }
245 
247 {
248  if (const_cast<const ImplType&>(mpImplFont)->meUnderline != eUnderline)
249  mpImplFont->meUnderline = eUnderline;
250 }
251 
253 {
254  if (const_cast<const ImplType&>(mpImplFont)->meOverline != eOverline)
255  mpImplFont->meOverline = eOverline;
256 }
257 
259 {
260  if (const_cast<const ImplType&>(mpImplFont)->meStrikeout != eStrikeout)
261  mpImplFont->meStrikeout = eStrikeout;
262 }
263 
265 {
266  if (const_cast<const ImplType&>(mpImplFont)->meRelief != eRelief)
267  mpImplFont->meRelief = eRelief;
268 }
269 
271 {
272  if (const_cast<const ImplType&>(mpImplFont)->meEmphasisMark != eEmphasisMark )
273  mpImplFont->meEmphasisMark = eEmphasisMark;
274 }
275 
276 void Font::SetWordLineMode( bool bWordLine )
277 {
278  if (const_cast<const ImplType&>(mpImplFont)->mbWordLine != bWordLine)
279  mpImplFont->mbWordLine = bWordLine;
280 }
281 
283 {
284  mpImplFont = rFont.mpImplFont;
285  return *this;
286 }
287 
288 Font& Font::operator=( vcl::Font&& rFont ) noexcept
289 {
290  mpImplFont = std::move(rFont.mpImplFont);
291  return *this;
292 }
293 
294 bool Font::operator==( const vcl::Font& rFont ) const
295 {
296  return mpImplFont == rFont.mpImplFont;
297 }
298 
299 void Font::Merge( const vcl::Font& rFont )
300 {
301  if ( !rFont.GetFamilyName().isEmpty() )
302  {
303  SetFamilyName( rFont.GetFamilyName() );
304  SetStyleName( rFont.GetStyleName() );
305  SetCharSet( GetCharSet() );
306  SetLanguageTag( rFont.GetLanguageTag() );
308  // don't use access methods here, might lead to AskConfig(), if DONTKNOW
310  SetPitch( rFont.mpImplFont->GetPitchNoAsk() );
311  }
312 
313  // don't use access methods here, might lead to AskConfig(), if DONTKNOW
314  if ( rFont.mpImplFont->GetWeightNoAsk() != WEIGHT_DONTKNOW )
315  SetWeight( rFont.GetWeight() );
316  if ( rFont.mpImplFont->GetItalicNoAsk() != ITALIC_DONTKNOW )
317  SetItalic( rFont.GetItalic() );
318  if ( rFont.mpImplFont->GetWidthTypeNoAsk() != WIDTH_DONTKNOW )
319  SetWidthType( rFont.GetWidthType() );
320 
321  if ( rFont.GetFontSize().Height() )
322  SetFontSize( rFont.GetFontSize() );
323  if ( rFont.GetUnderline() != LINESTYLE_DONTKNOW )
324  {
325  SetUnderline( rFont.GetUnderline() );
326  SetWordLineMode( rFont.IsWordLineMode() );
327  }
328  if ( rFont.GetOverline() != LINESTYLE_DONTKNOW )
329  {
330  SetOverline( rFont.GetOverline() );
331  SetWordLineMode( rFont.IsWordLineMode() );
332  }
333  if ( rFont.GetStrikeout() != STRIKEOUT_DONTKNOW )
334  {
335  SetStrikeout( rFont.GetStrikeout() );
336  SetWordLineMode( rFont.IsWordLineMode() );
337  }
338 
339  // Defaults?
340  SetOrientation( rFont.GetOrientation() );
341  SetVertical( rFont.IsVertical() );
342  SetEmphasisMark( rFont.GetEmphasisMark() );
344  SetOutline( rFont.IsOutline() );
345  SetShadow( rFont.IsShadow() );
346  SetRelief( rFont.GetRelief() );
347 }
348 
350 {
354  rAttrs.SetPitch( mpImplFont->GetPitchNoAsk() );
355  rAttrs.SetItalic( mpImplFont->GetItalicNoAsk() );
356  rAttrs.SetWeight( mpImplFont->GetWeightNoAsk() );
357  rAttrs.SetWidthType( WIDTH_DONTKNOW );
358  rAttrs.SetSymbolFlag( mpImplFont->GetCharSet() == RTL_TEXTENCODING_SYMBOL );
359 }
360 
361 SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont )
362 {
363  VersionCompat aCompat( rIStm, StreamMode::READ );
364  sal_uInt16 nTmp16(0);
365  sal_Int16 nTmps16(0);
366  bool bTmp(false);
367  sal_uInt8 nTmp8(0);
368 
369  rImplFont.SetFamilyName( rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet()) );
370  rImplFont.maStyleName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet());
371  TypeSerializer aSerializer(rIStm);
372  aSerializer.readSize(rImplFont.maAverageFontSize);
373 
374  rIStm.ReadUInt16( nTmp16 ); rImplFont.SetCharSet( static_cast<rtl_TextEncoding>(nTmp16) );
375  rIStm.ReadUInt16( nTmp16 ); rImplFont.SetFamilyType( static_cast<FontFamily>(nTmp16) );
376  rIStm.ReadUInt16( nTmp16 ); rImplFont.SetPitch( static_cast<FontPitch>(nTmp16) );
377  rIStm.ReadUInt16( nTmp16 ); rImplFont.SetWeight( static_cast<FontWeight>(nTmp16) );
378  rIStm.ReadUInt16( nTmp16 ); rImplFont.meUnderline = static_cast<FontLineStyle>(nTmp16);
379  rIStm.ReadUInt16( nTmp16 ); rImplFont.meStrikeout = static_cast<FontStrikeout>(nTmp16);
380  rIStm.ReadUInt16( nTmp16 ); rImplFont.SetItalic( static_cast<FontItalic>(nTmp16) );
381  rIStm.ReadUInt16( nTmp16 ); rImplFont.maLanguageTag.reset( LanguageType(nTmp16) );
382  rIStm.ReadUInt16( nTmp16 ); rImplFont.meWidthType = static_cast<FontWidth>(nTmp16);
383 
384  rIStm.ReadInt16( nTmps16 ); rImplFont.mnOrientation = Degree10(nTmps16);
385 
386  rIStm.ReadCharAsBool( bTmp ); rImplFont.mbWordLine = bTmp;
387  rIStm.ReadCharAsBool( bTmp ); rImplFont.mbOutline = bTmp;
388  rIStm.ReadCharAsBool( bTmp ); rImplFont.mbShadow = bTmp;
389  rIStm.ReadUChar( nTmp8 ); rImplFont.meKerning = static_cast<FontKerning>(nTmp8);
390 
391  if( aCompat.GetVersion() >= 2 )
392  {
393  rIStm.ReadUChar( nTmp8 ); rImplFont.meRelief = static_cast<FontRelief>(nTmp8);
394  rIStm.ReadUInt16( nTmp16 ); rImplFont.maCJKLanguageTag.reset( LanguageType(nTmp16) );
395  rIStm.ReadCharAsBool( bTmp ); rImplFont.mbVertical = bTmp;
396  rIStm.ReadUInt16( nTmp16 ); rImplFont.meEmphasisMark = static_cast<FontEmphasisMark>(nTmp16);
397  }
398 
399  if( aCompat.GetVersion() >= 3 )
400  {
401  rIStm.ReadUInt16( nTmp16 ); rImplFont.meOverline = static_cast<FontLineStyle>(nTmp16);
402  }
403 
404  // Relief
405  // CJKContextLanguage
406 
407  return rIStm;
408 }
409 
410 SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont )
411 {
412  VersionCompat aCompat( rOStm, StreamMode::WRITE, 3 );
413  TypeSerializer aSerializer(rOStm);
414  rOStm.WriteUniOrByteString( rImplFont.GetFamilyName(), rOStm.GetStreamCharSet() );
415  rOStm.WriteUniOrByteString( rImplFont.GetStyleName(), rOStm.GetStreamCharSet() );
416  aSerializer.writeSize(rImplFont.maAverageFontSize);
417 
418  rOStm.WriteUInt16( GetStoreCharSet( rImplFont.GetCharSet() ) );
419  rOStm.WriteUInt16( rImplFont.GetFamilyTypeNoAsk() );
420  rOStm.WriteUInt16( rImplFont.GetPitchNoAsk() );
421  rOStm.WriteUInt16( rImplFont.GetWeightNoAsk() );
422  rOStm.WriteUInt16( rImplFont.meUnderline );
423  rOStm.WriteUInt16( rImplFont.meStrikeout );
424  rOStm.WriteUInt16( rImplFont.GetItalicNoAsk() );
425  rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplFont.maLanguageTag.getLanguageType( false)) );
426  rOStm.WriteUInt16( rImplFont.GetWidthTypeNoAsk() );
427 
428  rOStm.WriteInt16( rImplFont.mnOrientation.get() );
429 
430  rOStm.WriteBool( rImplFont.mbWordLine );
431  rOStm.WriteBool( rImplFont.mbOutline );
432  rOStm.WriteBool( rImplFont.mbShadow );
433  rOStm.WriteUChar( static_cast<sal_uInt8>(rImplFont.meKerning) );
434 
435  // new in version 2
436  rOStm.WriteUChar( static_cast<unsigned char>(rImplFont.meRelief) );
437  rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplFont.maCJKLanguageTag.getLanguageType( false)) );
438  rOStm.WriteBool( rImplFont.mbVertical );
439  rOStm.WriteUInt16( static_cast<sal_uInt16>(rImplFont.meEmphasisMark) );
440 
441  // new in version 3
442  rOStm.WriteUInt16( rImplFont.meOverline );
443 
444  return rOStm;
445 }
446 
448 {
449  return ReadImplFont( rIStm, *rFont.mpImplFont );
450 }
451 
452 SvStream& WriteFont( SvStream& rOStm, const vcl::Font& rFont )
453 {
454  return WriteImplFont( rOStm, *rFont.mpImplFont );
455 }
456 
457 namespace
458 {
459  bool identifyTrueTypeFont( const void* i_pBuffer, sal_uInt32 i_nSize, Font& o_rResult )
460  {
461  bool bResult = false;
462  TrueTypeFont* pTTF = nullptr;
463  if( OpenTTFontBuffer( i_pBuffer, i_nSize, 0, &pTTF ) == SFErrCodes::Ok )
464  {
465  TTGlobalFontInfo aInfo;
466  GetTTGlobalFontInfo( pTTF, &aInfo );
467  // most importantly: the family name
468  if( aInfo.ufamily )
469  o_rResult.SetFamilyName( OUString(aInfo.ufamily) );
470  else if( aInfo.family )
471  o_rResult.SetFamilyName( OStringToOUString( aInfo.family, RTL_TEXTENCODING_ASCII_US ) );
472  // set weight
473  if( aInfo.weight )
474  {
475  if( aInfo.weight < FW_EXTRALIGHT )
476  o_rResult.SetWeight( WEIGHT_THIN );
477  else if( aInfo.weight < FW_LIGHT )
478  o_rResult.SetWeight( WEIGHT_ULTRALIGHT );
479  else if( aInfo.weight < FW_NORMAL )
480  o_rResult.SetWeight( WEIGHT_LIGHT );
481  else if( aInfo.weight < FW_MEDIUM )
482  o_rResult.SetWeight( WEIGHT_NORMAL );
483  else if( aInfo.weight < FW_SEMIBOLD )
484  o_rResult.SetWeight( WEIGHT_MEDIUM );
485  else if( aInfo.weight < FW_BOLD )
486  o_rResult.SetWeight( WEIGHT_SEMIBOLD );
487  else if( aInfo.weight < FW_EXTRABOLD )
488  o_rResult.SetWeight( WEIGHT_BOLD );
489  else if( aInfo.weight < FW_BLACK )
490  o_rResult.SetWeight( WEIGHT_ULTRABOLD );
491  else
492  o_rResult.SetWeight( WEIGHT_BLACK );
493  }
494  else
495  o_rResult.SetWeight( (aInfo.macStyle & 1) ? WEIGHT_BOLD : WEIGHT_NORMAL );
496  // set width
497  if( aInfo.width )
498  {
499  if( aInfo.width == FWIDTH_ULTRA_CONDENSED )
500  o_rResult.SetAverageFontWidth( WIDTH_ULTRA_CONDENSED );
501  else if( aInfo.width == FWIDTH_EXTRA_CONDENSED )
502  o_rResult.SetAverageFontWidth( WIDTH_EXTRA_CONDENSED );
503  else if( aInfo.width == FWIDTH_CONDENSED )
504  o_rResult.SetAverageFontWidth( WIDTH_CONDENSED );
505  else if( aInfo.width == FWIDTH_SEMI_CONDENSED )
506  o_rResult.SetAverageFontWidth( WIDTH_SEMI_CONDENSED );
507  else if( aInfo.width == FWIDTH_NORMAL )
508  o_rResult.SetAverageFontWidth( WIDTH_NORMAL );
509  else if( aInfo.width == FWIDTH_SEMI_EXPANDED )
510  o_rResult.SetAverageFontWidth( WIDTH_SEMI_EXPANDED );
511  else if( aInfo.width == FWIDTH_EXPANDED )
512  o_rResult.SetAverageFontWidth( WIDTH_EXPANDED );
513  else if( aInfo.width == FWIDTH_EXTRA_EXPANDED )
514  o_rResult.SetAverageFontWidth( WIDTH_EXTRA_EXPANDED );
515  else if( aInfo.width >= FWIDTH_ULTRA_EXPANDED )
516  o_rResult.SetAverageFontWidth( WIDTH_ULTRA_EXPANDED );
517  }
518  // set italic
519  o_rResult.SetItalic( (aInfo.italicAngle != 0) ? ITALIC_NORMAL : ITALIC_NONE );
520 
521  // set pitch
522  o_rResult.SetPitch( (aInfo.pitch == 0) ? PITCH_VARIABLE : PITCH_FIXED );
523 
524  // set style name
525  if( aInfo.usubfamily )
526  o_rResult.SetStyleName( OUString( aInfo.usubfamily ) );
527  else if( aInfo.subfamily )
528  o_rResult.SetStyleName( OUString::createFromAscii( aInfo.subfamily ) );
529 
530  // cleanup
531  CloseTTFont( pTTF );
532  // success
533  bResult = true;
534  }
535  return bResult;
536  }
537 
538  struct WeightSearchEntry
539  {
540  const char* string;
541  int string_len;
542  FontWeight weight;
543 
544  bool operator<( const WeightSearchEntry& rRight ) const
545  {
546  return rtl_str_compareIgnoreAsciiCase_WithLength( string, string_len, rRight.string, rRight.string_len ) < 0;
547  }
548  }
549  const weight_table[] =
550  {
551  { "black", 5, WEIGHT_BLACK },
552  { "bold", 4, WEIGHT_BOLD },
553  { "book", 4, WEIGHT_LIGHT },
554  { "demi", 4, WEIGHT_SEMIBOLD },
555  { "heavy", 5, WEIGHT_BLACK },
556  { "light", 5, WEIGHT_LIGHT },
557  { "medium", 6, WEIGHT_MEDIUM },
558  { "regular", 7, WEIGHT_NORMAL },
559  { "super", 5, WEIGHT_ULTRABOLD },
560  { "thin", 4, WEIGHT_THIN }
561  };
562 
563  bool identifyType1Font( const char* i_pBuffer, sal_uInt32 i_nSize, Font& o_rResult )
564  {
565  // might be a type1, find eexec
566  const char* pStream = i_pBuffer;
567  const char* const pExec = "eexec";
568  const char* pExecPos = std::search( pStream, pStream+i_nSize, pExec, pExec+5 );
569  if( pExecPos != pStream+i_nSize)
570  {
571  // find /FamilyName entry
572  static const char* const pFam = "/FamilyName";
573  const char* pFamPos = std::search( pStream, pExecPos, pFam, pFam+11 );
574  if( pFamPos != pExecPos )
575  {
576  // extract the string value behind /FamilyName
577  const char* pOpen = pFamPos+11;
578  while( pOpen < pExecPos && *pOpen != '(' )
579  pOpen++;
580  const char* pClose = pOpen;
581  while( pClose < pExecPos && *pClose != ')' )
582  pClose++;
583  if( pClose - pOpen > 1 )
584  {
585  o_rResult.SetFamilyName( OStringToOUString( std::string_view( pOpen+1, pClose-pOpen-1 ), RTL_TEXTENCODING_ASCII_US ) );
586  }
587  }
588 
589  // parse /ItalicAngle
590  static const char* const pItalic = "/ItalicAngle";
591  const char* pItalicPos = std::search( pStream, pExecPos, pItalic, pItalic+12 );
592  if( pItalicPos != pExecPos )
593  {
594  const char* pItalicEnd = pItalicPos + 12;
595  auto nItalic = rtl_str_toInt64_WithLength(pItalicEnd, 10, pExecPos - pItalicEnd);
596  o_rResult.SetItalic( (nItalic != 0) ? ITALIC_NORMAL : ITALIC_NONE );
597  }
598 
599  // parse /Weight
600  static const char* const pWeight = "/Weight";
601  const char* pWeightPos = std::search( pStream, pExecPos, pWeight, pWeight+7 );
602  if( pWeightPos != pExecPos )
603  {
604  // extract the string value behind /Weight
605  const char* pOpen = pWeightPos+7;
606  while( pOpen < pExecPos && *pOpen != '(' )
607  pOpen++;
608  const char* pClose = pOpen;
609  while( pClose < pExecPos && *pClose != ')' )
610  pClose++;
611  if( pClose - pOpen > 1 )
612  {
613  WeightSearchEntry aEnt;
614  aEnt.string = pOpen+1;
615  aEnt.string_len = (pClose-pOpen)-1;
616  aEnt.weight = WEIGHT_NORMAL;
617  WeightSearchEntry const * pFound = std::lower_bound( std::begin(weight_table), std::end(weight_table), aEnt );
618  if( pFound != std::end(weight_table) &&
619  rtl_str_compareIgnoreAsciiCase_WithLength( pFound->string, pFound->string_len, aEnt.string, aEnt.string_len) == 0 )
620  o_rResult.SetWeight( pFound->weight );
621  }
622  }
623 
624  // parse isFixedPitch
625  static const char* const pFixed = "/isFixedPitch";
626  const char* pFixedPos = std::search( pStream, pExecPos, pFixed, pFixed+13 );
627  if( pFixedPos != pExecPos )
628  {
629  // skip whitespace
630  while( pFixedPos < pExecPos-4 &&
631  ( *pFixedPos == ' ' ||
632  *pFixedPos == '\t' ||
633  *pFixedPos == '\r' ||
634  *pFixedPos == '\n' ) )
635  {
636  pFixedPos++;
637  }
638  // find "true" value
639  if( rtl_str_compareIgnoreAsciiCase_WithLength( pFixedPos, 4, "true", 4 ) == 0 )
640  o_rResult.SetPitch( PITCH_FIXED );
641  else
642  o_rResult.SetPitch( PITCH_VARIABLE );
643  }
644  }
645  return false;
646  }
647 }
648 
649 Font Font::identifyFont( const void* i_pBuffer, sal_uInt32 i_nSize )
650 {
651  Font aResult;
652  if( ! identifyTrueTypeFont( i_pBuffer, i_nSize, aResult ) )
653  {
654  const char* pStream = static_cast<const char*>(i_pBuffer);
655  if( pStream && i_nSize > 100 &&
656  *pStream == '%' && pStream[1] == '!' )
657  {
658  identifyType1Font( pStream, i_nSize, aResult );
659  }
660  }
661 
662  return aResult;
663 }
664 
665 // The inlines from the font.hxx header are now instantiated for pImpl-ification
666 const Color& Font::GetColor() const { return mpImplFont->maColor; }
667 const Color& Font::GetFillColor() const { return mpImplFont->maFillColor; }
669 
671 
672 const OUString& Font::GetFamilyName() const { return mpImplFont->GetFamilyName(); }
673 const OUString& Font::GetStyleName() const { return mpImplFont->maStyleName; }
674 
675 const Size& Font::GetFontSize() const { return mpImplFont->GetFontSize(); }
680 
681 rtl_TextEncoding Font::GetCharSet() const { return mpImplFont->GetCharSet(); }
682 
687 
689 bool Font::IsVertical() const { return mpImplFont->mbVertical; }
691 
697 
703 
704 int Font::GetQuality() const { return mpImplFont->GetQuality(); }
705 void Font::SetQuality( int nQuality ) { mpImplFont->SetQuality( nQuality ); }
706 void Font::IncreaseQualityBy( int nQualityAmount ) { mpImplFont->IncreaseQualityBy( nQualityAmount ); }
707 void Font::DecreaseQualityBy( int nQualityAmount ) { mpImplFont->DecreaseQualityBy( nQualityAmount ); }
708 
709 bool Font::IsOutline() const { return mpImplFont->mbOutline; }
710 bool Font::IsShadow() const { return mpImplFont->mbShadow; }
716 bool Font::IsWordLineMode() const { return mpImplFont->mbWordLine; }
717 bool Font::IsSameInstance( const vcl::Font& rFont ) const { return (mpImplFont == rFont.mpImplFont); }
718 
719 
721  meWeight( WEIGHT_DONTKNOW ),
722  meFamily( FAMILY_DONTKNOW ),
723  mePitch( PITCH_DONTKNOW ),
724  meWidthType( WIDTH_DONTKNOW ),
725  meItalic( ITALIC_NONE ),
726  meAlign( ALIGN_TOP ),
727  meUnderline( LINESTYLE_NONE ),
728  meOverline( LINESTYLE_NONE ),
729  meStrikeout( STRIKEOUT_NONE ),
730  meRelief( FontRelief::NONE ),
731  meEmphasisMark( FontEmphasisMark::NONE ),
732  meKerning( FontKerning::FontSpecific ),
733  meCharSet( RTL_TEXTENCODING_DONTKNOW ),
735  maCJKLanguageTag( LANGUAGE_DONTKNOW ),
736  mbSymbolFlag( false ),
737  mbOutline( false ),
738  mbConfigLookup( false ),
739  mbShadow( false ),
740  mbVertical( false ),
741  mbTransparent( true ),
744  mbWordLine( false ),
745  mnOrientation( 0 ),
746  mnQuality( 0 )
747 {}
748 
749 ImplFont::ImplFont( const ImplFont& rImplFont ) :
750  maFamilyName( rImplFont.maFamilyName ),
751  maStyleName( rImplFont.maStyleName ),
752  meWeight( rImplFont.meWeight ),
753  meFamily( rImplFont.meFamily ),
754  mePitch( rImplFont.mePitch ),
755  meWidthType( rImplFont.meWidthType ),
756  meItalic( rImplFont.meItalic ),
757  meAlign( rImplFont.meAlign ),
758  meUnderline( rImplFont.meUnderline ),
759  meOverline( rImplFont.meOverline ),
760  meStrikeout( rImplFont.meStrikeout ),
761  meRelief( rImplFont.meRelief ),
762  meEmphasisMark( rImplFont.meEmphasisMark ),
763  meKerning( rImplFont.meKerning ),
764  maAverageFontSize( rImplFont.maAverageFontSize ),
765  meCharSet( rImplFont.meCharSet ),
766  maLanguageTag( rImplFont.maLanguageTag ),
767  maCJKLanguageTag( rImplFont.maCJKLanguageTag ),
768  mbSymbolFlag( rImplFont.mbSymbolFlag ),
769  mbOutline( rImplFont.mbOutline ),
770  mbConfigLookup( rImplFont.mbConfigLookup ),
771  mbShadow( rImplFont.mbShadow ),
772  mbVertical( rImplFont.mbVertical ),
773  mbTransparent( rImplFont.mbTransparent ),
774  maColor( rImplFont.maColor ),
775  maFillColor( rImplFont.maFillColor ),
776  mbWordLine( rImplFont.mbWordLine ),
777  mnOrientation( rImplFont.mnOrientation ),
778  mnQuality( rImplFont.mnQuality )
779 {}
780 
781 bool ImplFont::operator==( const ImplFont& rOther ) const
782 {
783  // equality tests split up for easier debugging
784  if( (meWeight != rOther.meWeight)
785  || (meItalic != rOther.meItalic)
786  || (meFamily != rOther.meFamily)
787  || (mePitch != rOther.mePitch) )
788  return false;
789 
790  if( (meCharSet != rOther.meCharSet)
791  || (maLanguageTag != rOther.maLanguageTag)
792  || (maCJKLanguageTag != rOther.maCJKLanguageTag)
793  || (meAlign != rOther.meAlign) )
794  return false;
795 
796  if( (maAverageFontSize != rOther.maAverageFontSize)
797  || (mnOrientation != rOther.mnOrientation)
798  || (mbVertical != rOther.mbVertical) )
799  return false;
800 
801  if( (maFamilyName != rOther.maFamilyName)
802  || (maStyleName != rOther.maStyleName) )
803  return false;
804 
805  if( (maColor != rOther.maColor)
806  || (maFillColor != rOther.maFillColor) )
807  return false;
808 
809  if( (meUnderline != rOther.meUnderline)
810  || (meOverline != rOther.meOverline)
811  || (meStrikeout != rOther.meStrikeout)
812  || (meRelief != rOther.meRelief)
813  || (meEmphasisMark != rOther.meEmphasisMark)
814  || (mbWordLine != rOther.mbWordLine)
815  || (mbOutline != rOther.mbOutline)
816  || (mbShadow != rOther.mbShadow)
817  || (meKerning != rOther.meKerning)
818  || (mbTransparent != rOther.mbTransparent) )
819  return false;
820 
821  return true;
822 }
823 
825 {
826  if( mbConfigLookup )
827  return;
828 
829  mbConfigLookup = true;
830 
831  // prepare the FontSubst configuration lookup
832  const utl::FontSubstConfiguration& rFontSubst = utl::FontSubstConfiguration::get();
833 
834  OUString aShortName;
835  OUString aFamilyName;
836  ImplFontAttrs nType = ImplFontAttrs::None;
837  FontWeight eWeight = WEIGHT_DONTKNOW;
838  FontWidth eWidthType = WIDTH_DONTKNOW;
839  OUString aMapName = GetEnglishSearchFontName( maFamilyName );
840 
841  utl::FontSubstConfiguration::getMapName( aMapName,
842  aShortName, aFamilyName, eWeight, eWidthType, nType );
843 
844  // lookup the font name in the configuration
845  const utl::FontNameAttr* pFontAttr = rFontSubst.getSubstInfo( aMapName );
846 
847  // if the direct lookup failed try again with an alias name
848  if ( !pFontAttr && (aShortName != aMapName) )
849  pFontAttr = rFontSubst.getSubstInfo( aShortName );
850 
851  if( pFontAttr )
852  {
853  // the font was found in the configuration
854  if( meFamily == FAMILY_DONTKNOW )
855  {
856  if ( pFontAttr->Type & ImplFontAttrs::Serif )
858  else if ( pFontAttr->Type & ImplFontAttrs::SansSerif )
860  else if ( pFontAttr->Type & ImplFontAttrs::Typewriter )
862  else if ( pFontAttr->Type & ImplFontAttrs::Italic )
864  else if ( pFontAttr->Type & ImplFontAttrs::Decorative )
866  }
867 
868  if( mePitch == PITCH_DONTKNOW )
869  {
870  if ( pFontAttr->Type & ImplFontAttrs::Fixed )
871  mePitch = PITCH_FIXED;
872  }
873  }
874 
875  // if some attributes are still unknown then use the FontSubst magic
876  if( meFamily == FAMILY_DONTKNOW )
877  {
878  if( nType & ImplFontAttrs::Serif )
880  else if( nType & ImplFontAttrs::SansSerif )
882  else if( nType & ImplFontAttrs::Typewriter )
884  else if( nType & ImplFontAttrs::Italic )
886  else if( nType & ImplFontAttrs::Decorative )
888  }
889 
890  if( GetWeight() == WEIGHT_DONTKNOW )
891  SetWeight( eWeight );
892  if( meWidthType == WIDTH_DONTKNOW )
893  meWidthType = eWidthType;
894 }
895 
896 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
Definition: font/font.cxx:124
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SvStream & WriteBool(bool b)
Extra-light (Ultra-light)
Definition: sft.hxx:76
SvStream & ReadInt16(sal_Int16 &rInt16)
rtl_TextEncoding GetCharSet() const
Definition: impfont.hxx:50
FontKerning meKerning
Definition: impfont.hxx:106
void SetStrikeout(FontStrikeout)
Definition: font/font.cxx:258
#define FontAlign
Definition: font.hxx:37
void SetFillColor(const Color &)
Definition: font/font.cxx:89
sal_Unicode * usubfamily
subfamily name UCS2
Definition: sft.hxx:151
int pitch
0: proportional font, otherwise: monospaced
Definition: sft.hxx:156
static Font identifyFont(const void *pBuffer, sal_uInt32 nLen)
Definition: font/font.cxx:649
void SetAlignment(const TextAlign eAlignment)
Definition: impfont.hxx:63
FontStrikeout meStrikeout
Definition: impfont.hxx:103
void SetFontSize(const Size &)
Definition: font/font.cxx:118
50% of normal
Definition: sft.hxx:89
int GetQuality() const
Definition: impfont.hxx:77
Font & operator=(const Font &)
Definition: font/font.cxx:282
FontItalic meItalic
Definition: impfont.hxx:99
FontLineStyle meOverline
Definition: impfont.hxx:102
const OUString & GetFamilyName() const
Definition: font/font.cxx:672
void SetCharSet(const rtl_TextEncoding eCharSet)
Definition: impfont.hxx:64
FAMILY_SCRIPT
FontWidth meWidthType
Definition: impfont.hxx:98
void GetFontAttributes(FontAttributes &rAttrs) const
Definition: font/font.cxx:349
TextAlign meAlign
Definition: impfont.hxx:100
FontWeight meWeight
Definition: impfont.hxx:95
SvStream & WriteUInt16(sal_uInt16 nUInt16)
const OUString & GetStyleName() const
Definition: impfont.hxx:43
void SetCJKContextLanguage(LanguageType)
Definition: font/font.cxx:181
LanguageTag & reset(const OUString &rBcp47LanguageTag)
ImplFontAttrs Type
FAMILY_MODERN
void SetAverageFontWidth(tools::Long nWidth)
Definition: font/font.cxx:678
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
Bold.
Definition: sft.hxx:81
const OUString & GetStyleName() const
Definition: font/font.cxx:673
Color maFillColor
Definition: impfont.hxx:123
bool IsTransparent() const
bool IsOutline() const
Definition: font/font.cxx:709
FontWidth
LanguageType getLanguageType(bool bResolveSystem=true) const
void SetOverline(FontLineStyle)
Definition: font/font.cxx:252
char * subfamily
subfamily name
Definition: sft.hxx:150
FontLineStyle GetOverline() const
Definition: font/font.cxx:713
FontItalic GetItalic()
Definition: impfont.hxx:46
LanguageType GetCJKContextLanguage() const
Definition: font/font.cxx:686
const Size & GetFontSize() const
Definition: impfont.hxx:51
void CloseTTFont(TrueTypeFont *ttf)
TrueTypeFont destructor.
Definition: sft.cxx:1161
long Long
void SetQuality(int nQuality)
Definition: impfont.hxx:79
void writeSize(const Size &rSize)
FAMILY_DONTKNOW
void SetWidthType(const FontWidth eWidthType)
FontEmphasisMark
Black (Heavy)
Definition: sft.hxx:83
WEIGHT_THIN
SvStream & WriteFont(SvStream &rOStm, const vcl::Font &rFont)
Definition: font/font.cxx:452
SvStream & ReadCharAsBool(bool &rBool)
FontRelief meRelief
Definition: impfont.hxx:104
Normal (Regular)
Definition: sft.hxx:78
FontWeight GetWeightNoAsk() const
Definition: impfont.hxx:71
FontFamily meFamily
Definition: impfont.hxx:96
WEIGHT_BLACK
void SetWeight(FontWeight)
Definition: font/font.cxx:216
void SetOutline(bool bOutline)
Definition: font/font.cxx:234
bool IsKerning() const
Definition: font/font.cxx:211
Medium.
Definition: sft.hxx:79
WEIGHT_SEMIBOLD
ImplFontAttrs
void SetPitch(const FontPitch ePitch)
basegfx::BColor maColor
void SetCharSet(rtl_TextEncoding)
Definition: font/font.cxx:130
FAMILY_ROMAN
bool mbVertical
Definition: impfont.hxx:114
int width
value of WidthClass or 0 if can't be determined
Definition: sft.hxx:155
WEIGHT_LIGHT
bool operator<(const SwTextGlyphsKey &l, const SwTextGlyphsKey &r)
Semi-bold (Demi-bold)
Definition: sft.hxx:80
SvStream & WriteImplFont(SvStream &rOStm, const ImplFont &rImplFont)
Definition: font/font.cxx:410
FontFamily GetFamilyType()
Definition: font/font.cxx:696
tools::Long GetFontHeight() const
Definition: font/font.cxx:677
FontAlign GetAlignment() const
Definition: font/font.cxx:670
void SetQuality(int)
Definition: font/font.cxx:705
NONE
char * family
family name
Definition: sft.hxx:148
WEIGHT_BOLD
Medium, 100%.
Definition: sft.hxx:93
LanguageType GetLanguage() const
Definition: font/font.cxx:685
const OUString & GetFamilyName() const
Definition: impfont.hxx:41
void SetFontSize(const Size &rSize)
Definition: impfont.hxx:65
void SetWidthType(const FontWidth eWidthType)
Definition: impfont.hxx:62
FontItalic GetItalic()
Definition: font/font.cxx:695
constexpr::Color COL_TRANSPARENT(0xFF, 0xFF, 0xFF, 0xFF)
FontWidth GetWidthTypeNoAsk() const
Definition: impfont.hxx:74
void SetWeight(const FontWeight eWeight)
Definition: impfont.hxx:61
bool IsVertical() const
Definition: font/font.cxx:689
FontKerning GetKerning() const
Definition: font/font.cxx:690
Size maAverageFontSize
Definition: impfont.hxx:107
LINESTYLE_NONE
75% of normal
Definition: sft.hxx:91
OUString GetEnglishSearchFontName(const OUString &rInName)
62.5% of normal
Definition: sft.hxx:90
void AskConfig()
Definition: font/font.cxx:824
SvStream & WriteUniOrByteString(const OUString &rStr, rtl_TextEncoding eDestCharSet)
bool IsSymbolFont() const
Definition: impfont.hxx:53
FontPitch GetPitchNoAsk() const
Definition: impfont.hxx:73
void IncreaseQualityBy(int nQualityAmount)
Definition: impfont.hxx:80
void SetPitch(const FontPitch ePitch)
Definition: impfont.hxx:59
const LanguageTag & GetLanguageTag() const
Definition: font/font.cxx:683
bool IsSymbolFont() const
Definition: font/font.cxx:143
void SetUnderline(FontLineStyle)
Definition: font/font.cxx:246
LanguageTag maCJKLanguageTag
Definition: impfont.hxx:111
FontWidth GetWidthType()
Definition: font/font.cxx:694
FAMILY_DECORATIVE
void readSize(Size &rSize)
void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
Returns global font information about the TrueType font.
Definition: sft.cxx:2023
Extra-bold (Ultra-bold)
Definition: sft.hxx:82
FontKerning
Definition: fntstyle.hxx:28
FontEmphasisMark GetEmphasisMark() const
Definition: font/font.cxx:715
void SetLanguage(LanguageType)
Definition: font/font.cxx:175
void SetShadow(bool bShadow)
Definition: font/font.cxx:240
void SetPitch(FontPitch ePitch)
Definition: font/font.cxx:187
OUString maStyleName
Definition: impfont.hxx:94
rtl_TextEncoding GetStoreCharSet(rtl_TextEncoding eEncoding)
int GetQuality() const
Definition: font/font.cxx:704
FontFamily GetFamilyTypeNoAsk() const
Definition: impfont.hxx:70
FontWidth GetWidthType()
Definition: impfont.hxx:48
SvStream & ReadImplFont(SvStream &rIStm, ImplFont &rImplFont)
Definition: font/font.cxx:361
void SetRelief(FontRelief)
Definition: font/font.cxx:264
WEIGHT_DONTKNOW
void SetFamilyName(const OUString &sFamilyName)
Definition: impfont.hxx:55
void SetSymbolFlag(bool)
Definition: font/font.cxx:148
void SetAlignment(FontAlign)
Definition: font/font.cxx:102
void DecreaseQualityBy(int nQualityAmount)
Definition: impfont.hxx:81
virtual ~Font()
Definition: font/font.cxx:77
UNDERLYING_TYPE get() const
bool operator==(const ImplFont &) const
Definition: font/font.cxx:781
Degree10 mnOrientation
Definition: impfont.hxx:129
void SetFamilyName(const OUString &rFamilyName)
Definition: font/font.cxx:108
void SetWeight(const FontWeight eWeight)
FontEmphasisMark meEmphasisMark
Definition: impfont.hxx:105
FontPitch GetPitch()
Definition: font/font.cxx:692
rtl_TextEncoding meCharSet
Definition: impfont.hxx:108
void SetCJKContextLanguageTag(const LanguageTag &)
Definition: font/font.cxx:169
112.5% of normal
Definition: sft.hxx:94
void SetOrientation(Degree10 nLineOrientation)
Definition: font/font.cxx:193
LanguageTag maLanguageTag
Definition: impfont.hxx:110
void SetKerning(FontKerning nKerning)
Definition: font/font.cxx:205
void SetItalic(const FontItalic eItalic)
void SetFamilyName(const OUString &sFamilyName)
int italicAngle
in counter-clockwise degrees * 65536
Definition: sft.hxx:157
WEIGHT_MEDIUM
150% of normal
Definition: sft.hxx:96
bool mbConfigLookup
Definition: impfont.hxx:114
void SetWordLineMode(bool bWordLine)
Definition: font/font.cxx:276
bool IsWordLineMode() const
Definition: font/font.cxx:716
void SetSymbolFlag(const bool bSymbolFlag)
Definition: impfont.hxx:67
tools::Long Width() const
void SetSymbolFlag(const bool)
void IncreaseQualityBy(int)
Definition: font/font.cxx:706
FontItalic GetItalicNoAsk() const
Definition: impfont.hxx:72
Color maColor
Definition: impfont.hxx:122
bool IsShadow() const
Definition: font/font.cxx:710
#define LANGUAGE_DONTKNOW
void Merge(const Font &rFont)
Definition: font/font.cxx:299
PITCH_DONTKNOW
const Size & GetFontSize() const
Definition: font/font.cxx:675
FontStrikeout GetStrikeout() const
Definition: font/font.cxx:714
void SetWidthType(FontWidth)
Definition: font/font.cxx:222
SvStream & ReadUChar(unsigned char &rChar)
TextAlign GetAlignment() const
Definition: impfont.hxx:49
WEIGHT_ULTRABOLD
Light.
Definition: sft.hxx:77
const Color & GetFillColor() const
Definition: font/font.cxx:667
int weight
value of WeightClass or 0 if can't be determined
Definition: sft.hxx:154
200% of normal
Definition: sft.hxx:97
FontPitch
LINESTYLE_DONTKNOW
void SetColor(const Color &)
Definition: font/font.cxx:81
FontWeight GetWeight()
Definition: impfont.hxx:45
uno::Sequence< double > maFillColor
bool mbShadow
Definition: impfont.hxx:114
sal_uInt16 macStyle
macstyle bits from 'HEAD' table
Definition: sft.hxx:153
87.5% of normal
Definition: sft.hxx:92
FontFamily
FontRelief GetRelief() const
Definition: font/font.cxx:711
FontPitch GetPitch()
Definition: impfont.hxx:47
const LanguageTag & GetCJKContextLanguageTag() const
Definition: font/font.cxx:684
ALIGN_TOP
FontPitch mePitch
Definition: impfont.hxx:97
void SetEmphasisMark(FontEmphasisMark)
Definition: font/font.cxx:270
const Color & GetColor() const
Definition: font/font.cxx:666
FontWeight
void SetStyleName(const OUString &rStyleName)
Definition: font/font.cxx:113
void DecreaseQualityBy(int)
Definition: font/font.cxx:707
void SetStyleName(const OUString &sStyleName)
Definition: impfont.hxx:56
FontWeight GetWeight()
Definition: font/font.cxx:693
unsigned char sal_uInt8
WIDTH_DONTKNOW
bool mbTransparent
Definition: impfont.hxx:114
SvStream & ReadFont(SvStream &rIStm, vcl::Font &rFont)
Definition: font/font.cxx:447
void SetTransparent(bool bTransparent)
Definition: font/font.cxx:96
bool operator==(const Font &) const
Definition: font/font.cxx:294
FAMILY_SWISS
SvStream & WriteUChar(unsigned char nChar)
Sun Font Tools.
bool IsTransparent() const
Definition: font/font.cxx:668
void SetLanguageTag(const LanguageTag &)
Definition: font/font.cxx:163
ITALIC_DONTKNOW
SvStream & WriteInt16(sal_Int16 nInt16)
rtl_TextEncoding GetStreamCharSet() const
sal_Unicode * ufamily
family name UCS2
Definition: sft.hxx:149
tools::Long Height() const
125% of normal
Definition: sft.hxx:95
void SetStyleName(const OUString &sStyleName)
ImplType mpImplFont
Definition: font.hxx:171
QPRO_FUNC_TYPE nType
Degree10 GetOrientation() const
Definition: font/font.cxx:688
void SetFamilyType(const FontFamily eFontFamily)
Definition: impfont.hxx:57
FontFamily GetFamilyType()
Definition: impfont.hxx:42
LanguageTag maLanguageTag
bool mbWordLine
Definition: impfont.hxx:126
void SetVertical(bool bVertical)
Definition: font/font.cxx:199
bool IsSameInstance(const Font &) const
Definition: font/font.cxx:717
void SetFontHeight(tools::Long nHeight)
Definition: font/font.cxx:676
void SetItalic(FontItalic)
Definition: font/font.cxx:228
STRIKEOUT_DONTKNOW
FontLineStyle GetUnderline() const
Definition: font/font.cxx:712
OUString maFamilyName
Definition: impfont.hxx:93
void SetItalic(const FontItalic eItalic)
Definition: impfont.hxx:60
STRIKEOUT_NONE
FontLineStyle
bool mbOutline
Definition: impfont.hxx:114
tools::Long GetAverageFontWidth() const
Definition: font/font.cxx:679
FontStrikeout
FontLineStyle meUnderline
Definition: impfont.hxx:101
Return value of GetTTGlobalFontInfo()
Definition: sft.hxx:147
FontRelief
Definition: fntstyle.hxx:26
rtl_TextEncoding GetCharSet() const
Definition: font/font.cxx:681
void SetFamilyType(const FontFamily eFontFamily)
FontItalic
OUString ReadUniOrByteString(rtl_TextEncoding eSrcCharSet)
SFErrCodes OpenTTFontBuffer(const void *pBuffer, sal_uInt32 nLen, sal_uInt32 facenum, TrueTypeFont **ttf, const FontCharMapRef xCharMap)
TrueTypeFont constructor.
Definition: sft.cxx:1084