TwipsFromFont


Volver
'*********************************************************
' Function TwipsFromFont(
'          FontName As String,
'          Size As Long,
'          Weight As Long,
'          Italic As Boolean,
'          Underline As Boolean,
'          Cch As Long,
'          Caption As String,
'          MaxWidthCch As Long,
'          dx As Long,
'          dy As Long) As Boolean
'
' Este método calcula el ancho y alto en twips de una
' cadena.
'
' Argumentos:
'   FontName: Nombre del tipo de letra
'   Size: Tamaño de la letra
'   Weight: Grosor de la letra
'   Italic: ¿Letra cursiva?
'   Underline: ¿Subrayada?
'   Cch: (?¿?) Ni idea, de momento
'   Caption: Cadena que se analizará
'   MaxWidthCch: (?¿?) Ni idea, de momento
'   dx: Ancho resultante
'   dy: Alto resultante
'
Sub wzTwipsFromFont()
Dim wzFontName As String
Dim wzSize As Long
Dim wzWeight As Long
Dim wzItalic As Boolean
Dim wzUnderline As Boolean
Dim wzCch As Long
Dim wzCaption As String
Dim wzMaxWidthCch As Long
Dim wzdx As Long
Dim wzdy As Long

    WizHook.Key = 51488399
    
    wzFontName = "Arial"
    wzSize = 8
    wzItalic = True
    wzUnderline = True
    wzCaption = "cadena de muestra"
        
    WizHook.TwipsFromFont wzFontName, wzSize, wzWeight, _
                          wzItalic, wzUnderline, wzCch, _
                          wzCaption, wzMaxWidthCch, _
                          wzdx, wzdy

    Debug.Print "Ancho de la cadena: " & wzdx
    Debug.Print "Alto de la cadena: " & wzdy
    
End Sub
'*********************************************************
Contactar Última actualización 21/9/2003     © Juan M. Afán deRibera