eukalyptus memFont und GDI+

  • das ding ist ja aber das ich den font nicht als datei rumliegen haben will sondern mit gdi+ auf den eingegliederten font zugreifen kann

    ich bekomms einfach nich auf die kette die beiden funktionen zu verbinden^^

    EDIT: alternativ müsste es doch so klappen das ich sowas in die richtung schreiben kann:

    [autoit]

    _GDIPlus_PrivateAddFontFile($hFontCollection, Binary($bFont))

    [/autoit]

    kenn mich dafür nur leider zu wenig aus^^

    hier die einpack-funktion(der font liegt als variable in meinem script):

    [autoit]

    ; #FUNCTION# ======================================================================================
    ; Name ..........: _WinAPI_RemoveFontMemResourceEx()
    ; Description ...: Removes the fonts added from a memory image file.
    ; Syntax ........: _WinAPI_RemoveFontMemResourceEx($hFont)
    ; Parameters ....: $hFont- [in] A handle to the font-resource.
    ; Return values .: Success - True
    ; Failure - False
    ; Author ........: Eukalyptus
    ; Modified ......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........: @@MsdnLink@@ RemoveFontMemResourceEx
    ; Example .......:
    ; =================================================================================================

    [/autoit][autoit][/autoit][autoit]

    Func _WinAPI_RemoveFontMemResourceEx($hFont)
    Local $aResult = DllCall('gdi32.dll', 'boolean', 'RemoveFontMemResourceEx', 'handle', $hFont)
    If @error Then Return SetError(@error, 0, False)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_RemoveFontMemResourceEx

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ; #FUNCTION# ======================================================================================
    ; Name ..........: _WinAPI_AddFontMemResourceEx()
    ; Description ...: Adds the font resource from a memory image to the system.
    ; Syntax ........: _WinAPI_AddFontMemResourceEx($pbFont, $cbFont, $pdv, $pcFonts)
    ; Parameters ....: $pbFont - [in] A pointer to a font resource.
    ; $cbFont - [in] The number of bytes in the font resource that is pointed to by pbFont.
    ; $pdv - [in] Reserved. Must be 0.
    ; $pcFonts - [in] A pointer to a variable that specifies the number of fonts installed.
    ; Return values .: Success - the return value specifies the handle to the font added.
    ; Failure - 0
    ; Author ........: Eukalyptus
    ; Modified ......:
    ; Remarks .......:
    ; Related .......:
    ; Link ..........: @@MsdnLink@@ AddFontMemResourceEx
    ; Example .......:
    ; =================================================================================================

    [/autoit][autoit][/autoit][autoit]

    Func _WinAPI_AddFontMemResourceEx($pbFont, $cbFont, $pdv=0, $pcFonts=0)
    Local $aResult = DllCall('gdi32.dll', 'handle', 'AddFontMemResourceEx', 'ptr', $pbFont, 'dword', $cbFont, 'ptr', $pdv, 'dword*', $pcFonts)
    If @error Then Return SetError(@error, 0, False)
    Return $aResult[0]
    EndFunc ;==>_WinAPI_AddFontMemResourceEx

    [/autoit]
  • Die WinAPI-Funktionen funktionieren nur mit GDI(32). Die GDIP.au3 enthält doch die von dir gewünschte Funktion:
    _GDIPlus_PrivateCollectionAddMemoryFont