#cmdline "-s console" ' console application
#DEFINE UNICODE
#DEFINE _WIN32_WINNT &h0602
#INCLUDE ONCE "crInc\cPDF\cPDFFonts.bi"
USING AfxNova
Type FontDescriptor
FontName As WSTRING * 30
FontID As Long
FontStyle As Long
FontReferenced As Long
FontAscent As Long
FontCapHeight As Long
FontDescent As Long
FontFlags As Long
FontRectLeft As Long
FontRectTop As Long
FontRectRight As Long
FontRectBottom As Long
FontItalicAngle As Double
FontStemV As Long
FontWeight As Long
FontUnderlineThickness As Long
FontUnderlinePosition As Long
FontObject As Long
FontWidthObject As Long
FontDescriptorObject As Long
End Type
DIM oPDFFonts AS cPDFFonts
DIM sFontID AS DWSTRING
DIM dvFont AS DVARIANT
DIM sWidth AS DWSTRING
DIM uDescriptor AS FontDescriptor
print "Total Defined Fonts=" + str(oPDFFonts.TotalFonts)
print ""
SLEEP
oPDFFonts.GetFont(1, sFontID, dvFont, sWidth)
dvFont.ToBuffer(@uDescriptor, SIZEOF(uDescriptor))
print "Font Descriptor"
print ""
print uDescriptor.FontName
print str(uDescriptor.FontID)
print str(uDescriptor.FontStyle)
print str(uDescriptor.FontReferenced)
print str(uDescriptor.FontAscent)
print str(uDescriptor.FontCapHeight)
print str(uDescriptor.FontDescent)
print str(uDescriptor.FontFlags)
print str(uDescriptor.FontRectLeft)
print str(uDescriptor.FontRectTop)
print str(uDescriptor.FontRectRight)
print str(uDescriptor.FontRectBottom)
print str(uDescriptor.FontItalicAngle)
print str(uDescriptor.FontStemV)
print str(uDescriptor.FontWeight)
print str(uDescriptor.FontUnderlineThickness)
print str(uDescriptor.FontUnderlinePosition)
SLEEP
print ""
print "Font Widths"
print ""
print sWidth
SLEEP
DIM nStart AS LONG = 1
DIM arWidths() AS LONG
WHILE nStart < LEN(sWidthList)
sWidth = AfxStrExtract(nStart,sWidthList,",",",")
AppendElementToArray (arWidths, CLNG(sWidth))
nStart = nStart + LEN(sWidth) + 1
WEND
Type FontDescriptor
FontName As WSTRING * 30
FontID As Long
FontStyle As Long
FontReferenced As Long
FontAscent As Long
FontCapHeight As Long
FontDescent As Long
FontFlags As Long
FontRectLeft As Long
FontRectTop As Long
FontRectRight As Long
FontRectBottom As Long
FontItalicAngle As Double
FontStemV As Long
FontWeight As Long
FontUnderlineThickness As Long
FontUnderlinePosition As Long
FontObject As Long
FontWidthObject As Long
FontDescriptorObject As Long
End Type
DIM uDescriptor AS FontDescriptor
DIM uDescriptor1 AS FontDescriptor
DIM oDicObj AS CDicObj
DIM dv AS DVARIANT
uDescriptor.FontName = "Arial"
uDescriptor.FontID = 1
uDescriptor.FontStyle = 1
uDescriptor.FontReferenced = 0
uDescriptor.FontAscent = 905
uDescriptor.FontCapHeight = 728
uDescriptor.FontDescent = -210
uDescriptor.FontFlags = 32
uDescriptor.FontRectLeft = -666
uDescriptor.FontRectTop = -210
uDescriptor.FontRectRight = 2000
uDescriptor.FontRectBottom = 728
uDescriptor.FontItalicAngle = 0
uDescriptor.FontStemV = 44
uDescriptor.FontWeight = 400
uDescriptor.FontUnderlineThickness = 73
uDescriptor.FontUnderlinePosition = -106
dv.PutBuffer(@uDescriptor, SIZEOF(uDescriptor))
oDicObj.Add "F1", dv
dv = oDicObj.Item("F1")
dv.ToBuffer(@uDescriptor1, SIZEOF(uDescriptor1))
print uDescriptor1.FontName
print str(uDescriptor1.FontID)
print str(uDescriptor1.FontStyle)
print str(uDescriptor1.FontReferenced)
print str(uDescriptor1.FontAscent)
print str(uDescriptor1.FontCapHeight)
print str(uDescriptor1.FontDescent)
print str(uDescriptor1.FontFlags)
print str(uDescriptor1.FontRectLeft)
print str(uDescriptor1.FontRectTop)
print str(uDescriptor1.FontRectRight)
print str(uDescriptor1.FontRectBottom)
print str(uDescriptor1.FontItalicAngle)
print str(uDescriptor1.FontStemV)
print str(uDescriptor1.FontWeight)
print str(uDescriptor1.FontUnderlineThickness)
print str(uDescriptor1.FontUnderlinePosition)
#cmdline "-s console"
#INCLUDE ONCE "AfxNova/CDicObj.inc"
USING AfxNova
TYPE Foo
x AS long
y as long
b as WSTRING * 260
END type
' // Creates an instance of the CDicObj class
DIM pDic AS CDicObj
' // Creates an instance of the Foo type
DIM t AS Foo = (12345, 72727, "Test string")
' // Assigns it to a DVARIANT
DIM dv AS DVARIANT
dv.PutBuffer(@t, SIZEOF(t))
' // Adds the type to the dictionary
pDic.Add "Foo1", dv
' // Creates another instance of the Foo type
DIM t2 AS Foo = (111111, 22222, "Test string 2")
' // Assigns it to a DVARIANT
DIM dv2 AS DVARIANT
dv2.PutBuffer(@t2, SIZEOF(t2))
' // Adds the type to the dictionary
pDic.Add "Foo2", dv2
' // Gets Foo1 from the dictionary
DIM dvFoo1 AS DVARIANT
dvFoo1 = pDic.Item("Foo1")
' // Assigns it to a Foo structure
DIM tFoo1 AS Foo
dvFoo1.ToBuffer(@tFoo1, SIZEOF(tFoo1))
' // DIsplays the values
print tFoo1.x
print tFoo1.y
print tFoo1.b
' // Gets Foo2 from the dictionary
DIM dvFoo2 AS DVARIANT
dvFoo2 = pDic.Item("Foo2")
' // Assigns it to a Foo structure
DIM tFoo2 AS Foo
dvFoo2.ToBuffer(@tFoo2, SIZEOF(tFoo2))
' // DIsplays the values
print tFoo2.x
print tFoo2.y
print tFoo2.b
PRINT
PRINT "Press any key..."
SLEEP
Quote from: hajubu on May 02, 2026, 06:45:56 PMArial
42926416
0
1662031610
29243
42926416
0
42934288
0
... and_eight_more_zeros