View | Details | Raw Unified | Return to issue 64671
Collapse All | Expand All

(-)cppcanvas/source/mtfrenderer/implrenderer.cxx (-1 / +9 lines)
Lines 43-48 Link Here
43
#include <com/sun/star/rendering/TexturingMode.hpp>
43
#include <com/sun/star/rendering/TexturingMode.hpp>
44
#include <com/sun/star/uno/Sequence.hxx>
44
#include <com/sun/star/uno/Sequence.hxx>
45
#include <com/sun/star/geometry/RealPoint2D.hpp>
45
#include <com/sun/star/geometry/RealPoint2D.hpp>
46
#include <com/sun/star/rendering/PanoseProportion.hpp>
46
#include <com/sun/star/rendering/ViewState.hpp>
47
#include <com/sun/star/rendering/ViewState.hpp>
47
#include <com/sun/star/rendering/RenderState.hpp>
48
#include <com/sun/star/rendering/RenderState.hpp>
48
#include <com/sun/star/rendering/XCanvasFont.hpp>
49
#include <com/sun/star/rendering/XCanvasFont.hpp>
Lines 850-855 Link Here
850
                rParms.mrParms.maFontLetterForm.isValid() ?
851
                rParms.mrParms.maFontLetterForm.isValid() ?
851
                rParms.mrParms.maFontLetterForm.getValue() :
852
                rParms.mrParms.maFontLetterForm.getValue() :
852
                (rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
853
                (rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
854
            aFontRequest.FontDescription.FontDescription.Proportion = 
855
                rParms.mrParms.maFontProportion.isValid() ?
856
                rParms.mrParms.maFontProportion.getValue() :
857
                (rFont.GetPitch() == PITCH_FIXED)
858
                    ? rendering::PanoseProportion::MONO_SPACED
859
                    : rendering::PanoseProportion::ANYTHING;
853
860
854
            LanguageType aLang = rFont.GetLanguage();
861
            LanguageType aLang = rFont.GetLanguage();
855
            aFontRequest.Locale = MsLangId::convertLanguageToLocale(aLang, false);
862
            aFontRequest.Locale = MsLangId::convertLanguageToLocale(aLang, false);
Lines 2967-2973 Link Here
2967
            if( rParams.maFontName.isValid() ||
2974
            if( rParams.maFontName.isValid() ||
2968
                rParams.maFontWeight.isValid() ||
2975
                rParams.maFontWeight.isValid() ||
2969
                rParams.maFontLetterForm.isValid() ||
2976
                rParams.maFontLetterForm.isValid() ||
2970
                rParams.maFontUnderline.isValid() )
2977
                rParams.maFontUnderline.isValid() ||
2978
                rParams.maFontProportion.isValid() )
2971
            {
2979
            {
2972
                ::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
2980
                ::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
2973
                    
2981
                    
(-)cppcanvas/inc/cppcanvas/renderer.hxx (+3 lines)
Lines 139-144 Link Here
139
            /// Optionally forces the given font letter form (italics etc.) for all text actions
139
            /// Optionally forces the given font letter form (italics etc.) for all text actions
140
            ::comphelper::OptionalValue< sal_Int8 >					maFontLetterForm;
140
            ::comphelper::OptionalValue< sal_Int8 >					maFontLetterForm;
141
141
142
            /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
143
            ::comphelper::OptionalValue< sal_Int8 >					maFontProportion;
144
142
            /// Optionally forces underlining for all text actions
145
            /// Optionally forces underlining for all text actions
143
            ::comphelper::OptionalValue< bool >						maFontUnderline;
146
            ::comphelper::OptionalValue< bool >						maFontUnderline;
144
        };
147
        };
(-)canvas/source/directx/dx_textlayout_drawhelper.cxx (+6 lines)
Lines 135-140 Link Here
135
            aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
135
            aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
136
            aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
136
            aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
137
            aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
137
            aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
138
            aFont.SetPitch(
139
                    rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
140
                    ? PITCH_FIXED : PITCH_VARIABLE);
138
141
139
            aFont.SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
142
            aFont.SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
140
143
Lines 267-272 Link Here
267
        aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
270
        aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
268
        aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
271
        aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
269
        aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
272
        aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
273
        aFont.SetPitch(
274
                rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
275
                ? PITCH_FIXED : PITCH_VARIABLE);
270
276
271
        // adjust to stretched font
277
        // adjust to stretched font
272
        if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
278
        if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
(-)canvas/source/vcl/canvasfont.cxx (+5 lines)
Lines 38-43 Link Here
38
#include <i18npool/mslangid.hxx>
38
#include <i18npool/mslangid.hxx>
39
#include <vcl/metric.hxx>
39
#include <vcl/metric.hxx>
40
40
41
#include <com/sun/star/rendering/PanoseProportion.hpp>
42
41
#include "canvasfont.hxx"
43
#include "canvasfont.hxx"
42
#include "textlayout.hxx"
44
#include "textlayout.hxx"
43
45
Lines 66-71 Link Here
66
        // TODO(F2): improve panose->vclenum conversion
68
        // TODO(F2): improve panose->vclenum conversion
67
        maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
69
        maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
68
        maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
70
        maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
71
        maFont->SetPitch(
72
                rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
73
                    ? PITCH_FIXED : PITCH_VARIABLE);
69
74
70
		maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
75
		maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
71
76
(-)canvas/source/cairo/cairo_canvasfont.cxx (+5 lines)
Lines 33-38 Link Here
33
33
34
#include <canvas/debug.hxx>
34
#include <canvas/debug.hxx>
35
35
36
#include <com/sun/star/rendering/PanoseProportion.hpp>
37
36
#include <rtl/math.hxx>
38
#include <rtl/math.hxx>
37
#include <basegfx/numeric/ftools.hxx>
39
#include <basegfx/numeric/ftools.hxx>
38
40
Lines 86-91 Link Here
86
        // TODO(F2): improve panose->vclenum conversion
88
        // TODO(F2): improve panose->vclenum conversion
87
        maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
89
        maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
88
        maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
90
        maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
91
        maFont->SetPitch(
92
                rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
93
                    ? PITCH_FIXED : PITCH_VARIABLE);
89
94
90
        maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
95
        maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
91
96
(-)drawinglayer/source/processor2d/canvasprocessor.cxx (+5 lines)
Lines 57-62 Link Here
57
#include <basegfx/tuple/b2i64tuple.hxx>
57
#include <basegfx/tuple/b2i64tuple.hxx>
58
#include <basegfx/range/b2irange.hxx>
58
#include <basegfx/range/b2irange.hxx>
59
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
59
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
60
#include <com/sun/star/rendering/PanoseProportion.hpp>
60
#include <com/sun/star/rendering/CompositeOperation.hpp>
61
#include <com/sun/star/rendering/CompositeOperation.hpp>
61
#include <com/sun/star/rendering/StrokeAttributes.hpp>
62
#include <com/sun/star/rendering/StrokeAttributes.hpp>
62
#include <com/sun/star/rendering/PathJoinType.hpp>
63
#include <com/sun/star/rendering/PathJoinType.hpp>
Lines 1517-1522 Link Here
1517
                    aFontRequest.FontDescription.IsVertical = rFontAttr.getVertical() ? util::TriState_YES : util::TriState_NO;
1518
                    aFontRequest.FontDescription.IsVertical = rFontAttr.getVertical() ? util::TriState_YES : util::TriState_NO;
1518
                    // TODO(F2): improve vclenum->panose conversion
1519
                    // TODO(F2): improve vclenum->panose conversion
1519
                    aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttr.getWeight());
1520
                    aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttr.getWeight());
1521
                    aFontRequest.FontDescription.FontDescription.Proportion =
1522
                        rFontAttr.getMonospaced()
1523
                            ? rendering::PanoseProportion::MONO_SPACED
1524
                            : rendering::PanoseProportion::ANYTHING;
1520
                    aFontRequest.FontDescription.FontDescription.Letterform = rFontAttr.getItalic() ? 9 : 0;
1525
                    aFontRequest.FontDescription.FontDescription.Letterform = rFontAttr.getItalic() ? 9 : 0;
1521
1526
1522
                    // init CellSize to 1.0, else a default font height will be used
1527
                    // init CellSize to 1.0, else a default font height will be used
(-)drawinglayer/source/primitive2d/textlayoutdevice.cxx (+2 lines)
Lines 406-411 Link Here
406
			aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
406
			aRetval.SetWeight(static_cast<FontWeight>(rFontAttribute.getWeight()));
407
			aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
407
			aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
408
			aRetval.SetOutline(rFontAttribute.getOutline());
408
			aRetval.SetOutline(rFontAttribute.getOutline());
409
            aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
409
            aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
410
            aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
410
411
411
#ifdef WIN32
412
#ifdef WIN32
Lines 445-450 Link Here
445
                RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
446
                RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
446
			    rFont.IsVertical(),
447
			    rFont.IsVertical(),
447
			    ITALIC_NONE != rFont.GetItalic(),
448
			    ITALIC_NONE != rFont.GetItalic(),
449
                PITCH_FIXED == rFont.GetPitch(),
448
			    rFont.IsOutline(),
450
			    rFont.IsOutline(),
449
                bRTL,
451
                bRTL,
450
                bBiDiStrong);
452
                bBiDiStrong);
(-)drawinglayer/source/attribute/fontattribute.cxx (-4 / +16 lines)
Lines 55-60 Link Here
55
			unsigned									mbOutline : 1;      // Outline Flag
55
			unsigned									mbOutline : 1;      // Outline Flag
56
            unsigned                                    mbRTL : 1;          // RTL Flag
56
            unsigned                                    mbRTL : 1;          // RTL Flag
57
            unsigned                                    mbBiDiStrong : 1;   // BiDi Flag
57
            unsigned                                    mbBiDiStrong : 1;   // BiDi Flag
58
            unsigned                                    mbMonospaced : 1;
58
59
59
            ImpFontAttribute(
60
            ImpFontAttribute(
60
                const String& rFamilyName,
61
                const String& rFamilyName,
Lines 63-68 Link Here
63
                bool bSymbol,
64
                bool bSymbol,
64
                bool bVertical,
65
                bool bVertical,
65
                bool bItalic,
66
                bool bItalic,
67
                bool bMonospaced,
66
                bool bOutline,
68
                bool bOutline,
67
                bool bRTL,
69
                bool bRTL,
68
                bool bBiDiStrong)
70
                bool bBiDiStrong)
Lines 75-81 Link Here
75
			    mbItalic(bItalic),
77
			    mbItalic(bItalic),
76
			    mbOutline(bOutline),
78
			    mbOutline(bOutline),
77
                mbRTL(bRTL),
79
                mbRTL(bRTL),
78
                mbBiDiStrong(bBiDiStrong)
80
                mbBiDiStrong(bBiDiStrong),
81
                mbMonospaced(bMonospaced)
79
            {
82
            {
80
            }
83
            }
81
84
Lines 89-94 Link Here
89
            bool getOutline() const { return mbOutline; }
92
            bool getOutline() const { return mbOutline; }
90
            bool getRTL() const { return mbRTL; }
93
            bool getRTL() const { return mbRTL; }
91
            bool getBiDiStrong() const { return mbBiDiStrong; }
94
            bool getBiDiStrong() const { return mbBiDiStrong; }
95
            bool getMonospaced() const { return mbMonospaced; }
92
96
93
            bool operator==(const ImpFontAttribute& rCompare) const
97
            bool operator==(const ImpFontAttribute& rCompare) const
94
            {
98
            {
Lines 100-106 Link Here
100
				    && getItalic() == rCompare.getItalic()
104
				    && getItalic() == rCompare.getItalic()
101
				    && getOutline() == rCompare.getOutline()
105
				    && getOutline() == rCompare.getOutline()
102
				    && getRTL() == rCompare.getRTL()
106
				    && getRTL() == rCompare.getRTL()
103
				    && getBiDiStrong() == rCompare.getBiDiStrong());
107
				    && getBiDiStrong() == rCompare.getBiDiStrong()
108
				    && getMonospaced() == rCompare.getMonospaced());
104
            }
109
            }
105
110
106
            static ImpFontAttribute* get_global_default()
111
            static ImpFontAttribute* get_global_default()
Lines 112-118 Link Here
112
                    pDefault = new ImpFontAttribute(
117
                    pDefault = new ImpFontAttribute(
113
                        String(), String(),
118
                        String(), String(),
114
                        0,
119
                        0,
115
                        false, false, false, false, false, false);
120
                        false, false, false, false, false, false, false);
116
121
117
                    // never delete; start with RefCount 1, not 0
122
                    // never delete; start with RefCount 1, not 0
118
    			    pDefault->mnRefCount++;
123
    			    pDefault->mnRefCount++;
Lines 129-139 Link Here
129
            bool bSymbol,
134
            bool bSymbol,
130
            bool bVertical,
135
            bool bVertical,
131
            bool bItalic,
136
            bool bItalic,
137
            bool bMonospaced,
132
            bool bOutline,
138
            bool bOutline,
133
            bool bRTL,
139
            bool bRTL,
134
            bool bBiDiStrong)
140
            bool bBiDiStrong)
135
		:	mpFontAttribute(new ImpFontAttribute(
141
		:	mpFontAttribute(new ImpFontAttribute(
136
                rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bOutline, bRTL, bBiDiStrong))
142
                rFamilyName, rStyleName, nWeight, bSymbol, bVertical, bItalic, bMonospaced, bOutline, bRTL, bBiDiStrong))
137
		{
143
		{
138
		}
144
		}
139
145
Lines 246-251 Link Here
246
            return mpFontAttribute->getBiDiStrong(); 
252
            return mpFontAttribute->getBiDiStrong(); 
247
        }
253
        }
248
254
255
        bool FontAttribute::getMonospaced() const 
256
        { 
257
            return mpFontAttribute->getMonospaced(); 
258
        }
259
260
249
    } // end of namespace attribute
261
    } // end of namespace attribute
250
} // end of namespace drawinglayer
262
} // end of namespace drawinglayer
251
263
(-)drawinglayer/inc/drawinglayer/attribute/fontattribute.hxx (+2 lines)
Lines 65-70 Link Here
65
                bool bSymbol = false,
65
                bool bSymbol = false,
66
                bool bVertical = false,
66
                bool bVertical = false,
67
                bool bItalic = false,
67
                bool bItalic = false,
68
                bool bMonospaced = false,
68
                bool bOutline = false,
69
                bool bOutline = false,
69
                bool bRTL = false,
70
                bool bRTL = false,
70
                bool bBiDiStrong = false);
71
                bool bBiDiStrong = false);
Lines 89-94 Link Here
89
            bool getOutline() const;
90
            bool getOutline() const;
90
            bool getRTL() const;
91
            bool getRTL() const;
91
            bool getBiDiStrong() const;
92
            bool getBiDiStrong() const;
93
            bool getMonospaced() const;
92
		};
94
		};
93
	} // end of namespace attribute
95
	} // end of namespace attribute
94
} // end of namespace drawinglayer
96
} // end of namespace drawinglayer

Return to issue 64671