Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/previewimageprovider.cpp
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 72 | { | |||
---|---|---|---|---|---|
76 | 76 | | |||
77 | int subPixelIndex = 0; | 77 | int subPixelIndex = 0; | ||
78 | int hintingIndex = 0; | 78 | int hintingIndex = 0; | ||
79 | 79 | | |||
80 | const auto idpart = id.splitRef(QLatin1Char('.'))[0]; | 80 | const auto idpart = id.splitRef(QLatin1Char('.'))[0]; | ||
81 | const auto sections = idpart.split(QLatin1Char('_')); | 81 | const auto sections = idpart.split(QLatin1Char('_')); | ||
82 | 82 | | |||
83 | if (sections.size() >= 2) { | 83 | if (sections.size() >= 2) { | ||
84 | subPixelIndex = sections[0].toInt(); | 84 | subPixelIndex = sections[0].toInt() + KXftConfig::SubPixel::None; | ||
85 | hintingIndex = sections[1].toInt(); | 85 | hintingIndex = sections[1].toInt() + KXftConfig::Hint::None; | ||
86 | } else { | ||||
87 | return QImage(); | ||||
86 | } | 88 | } | ||
87 | 89 | | |||
88 | KXftConfig xft; | 90 | KXftConfig xft; | ||
89 | 91 | | |||
90 | 92 | | |||
91 | KXftConfig::AntiAliasing::State oldAntialiasing = xft.getAntiAliasing(); | 93 | KXftConfig::AntiAliasing::State oldAntialiasing = xft.getAntiAliasing(); | ||
92 | double oldStart,oldEnd; | 94 | double oldStart = 0; | ||
95 | double oldEnd = 0; | ||||
93 | xft.getExcludeRange(oldStart, oldEnd); | 96 | xft.getExcludeRange(oldStart, oldEnd); | ||
94 | KXftConfig::SubPixel::Type oldSubPixelType; | 97 | KXftConfig::SubPixel::Type oldSubPixelType = KXftConfig::SubPixel::NotSet; | ||
95 | xft.getSubPixelType(oldSubPixelType); | 98 | xft.getSubPixelType(oldSubPixelType); | ||
96 | KXftConfig::Hint::Style oldHintStyle; | 99 | KXftConfig::Hint::Style oldHintStyle = KXftConfig::Hint::NotSet; | ||
97 | xft.getHintStyle(oldHintStyle); | 100 | xft.getHintStyle(oldHintStyle); | ||
98 | 101 | | |||
99 | 102 | | |||
100 | xft.setAntiAliasing(KXftConfig::AntiAliasing::Enabled); | 103 | xft.setAntiAliasing(KXftConfig::AntiAliasing::Enabled); | ||
101 | xft.setExcludeRange(0, 0); | 104 | xft.setExcludeRange(0, 0); | ||
102 | 105 | | |||
103 | KXftConfig::SubPixel::Type subPixelType = (KXftConfig::SubPixel::Type)subPixelIndex; | 106 | KXftConfig::SubPixel::Type subPixelType = (KXftConfig::SubPixel::Type)subPixelIndex; | ||
104 | xft.setSubPixelType(subPixelType); | 107 | xft.setSubPixelType(subPixelType); | ||
Show All 29 Lines |