Changeset 473 for trunk/Include/Classes/System/Drawing/Font.ab
- Timestamp:
- Mar 12, 2008, 9:54:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Drawing/Font.ab
r212 r473 1 #ifndef _GDIPLUSFONT_H 2 #define _GDIPLUSFONT_H 3 4 #require <GdiPlus.ab> 5 #require <Classes/System/Drawing/misc.ab> 1 /** 2 @file Classes/System/Drawing/Font.ab 3 @brief Fontクラスなどの実装。 4 */ 5 6 6 #require <Classes/System/Drawing/Graphics.ab> 7 7 … … 10 10 11 11 Class Font 12 Implements System.IDisposable 12 13 Public 13 14 ' friend class Graphics … … 130 131 /*IN*/ style As Long, /*IN*/ unit As GraphicsUnit, 131 132 /*IN const*/ fontCollection As FontCollection) 132 #ifdef __STRING_IS_NOT_UNICODE 133 Dim oldAlloc = _System_AllocForConvertedString 134 _System_AllocForConvertedString = AddressOf (_System_malloc) 135 Dim name = ToWCStr(familyName) 136 Font(name, emSize, style, unit, fontCollection) 137 _System_free(name) 138 _System_AllocForConvertedString = oldAlloc 139 #else 140 Font(familyName.Chars, emSize, style, unit, fontCollection) 141 #endif 133 Font(ToWCStr(familyName), emSize, style, unit, fontCollection) 142 134 End Sub 143 135 144 136 Const Function GetLogFontA(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONTA) As Status 145 137 Dim nativeGraphics As *GpGraphics 146 If VarPtr(g) <> 0Then138 If Not ActiveBasic.IsNothing(g) Then 147 139 nativeGraphics = g.nativeGraphics 148 140 End If … … 152 144 Const Function GetLogFontW(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONTW) As Status 153 145 Dim nativeGraphics As *GpGraphics 154 If VarPtr(g) <> 0Then146 If Not ActiveBasic.IsNothing(g) Then 155 147 nativeGraphics = g.nativeGraphics 156 148 End If … … 160 152 Const Function GetLogFont(/*IN const*/ g As Graphics, /*OUT*/ ByRef lf As LOGFONT) As Status 161 153 Dim nativeGraphics As *GpGraphics 162 If VarPtr(g) <> 0Then154 If Not ActiveBasic.IsNothing(g) Then 163 155 nativeGraphics = g.nativeGraphics 164 156 End If … … 212 204 Const Function GetHeight(/*IN const*/ g As Graphics) As Single 213 205 Dim nativeGraphics As *GpGraphics 214 If VarPtr(g) <> 0Then206 If Not ActiveBasic.IsNothing(g) Then 215 207 nativeGraphics = g.NativeGraphics 216 208 End If … … 270 262 'Const Function SizeInPoint() As Boolean 271 263 272 Const Function NativeFont() As *GpFont273 Return nativeFont274 End Function275 276 264 Const Function StrikeOut() As Boolean 277 265 Dim lf As LOGFONT … … 341 329 /*mutable*/ lastResult As Status 342 330 End Class 343 344 #endif
Note:
See TracChangeset
for help on using the changeset viewer.