private void FreeGlyphBuffers() { GlyphCapacity = 0; if (Glyphs != null) { Memory.Free(Glyphs); Glyphs = null; } if (GlyphVisualAttributes != null) { Memory.Free(GlyphVisualAttributes); GlyphVisualAttributes = null; } if (GlyphAdvanceWidths != null) { Memory.Free(GlyphAdvanceWidths); GlyphAdvanceWidths = null; } if (GlyphOffsets != null) { Memory.Free(GlyphOffsets); GlyphOffsets = null; } }
private void ReAllocGlyphBuffers(int newGlyphCapacity) { Glyphs = (ushort *)Memory.ReAlloc(Glyphs, newGlyphCapacity * sizeof(ushort)); GlyphVisualAttributes = (SCRIPT_VISATTR *)Memory.ReAlloc(GlyphVisualAttributes, newGlyphCapacity * sizeof(SCRIPT_VISATTR)); GlyphAdvanceWidths = (int *)Memory.ReAlloc(GlyphAdvanceWidths, newGlyphCapacity * sizeof(int)); GlyphOffsets = (GOFFSET *)Memory.ReAlloc(GlyphOffsets, newGlyphCapacity * sizeof(GOFFSET)); }
private void InitializeGlyphBuffers() { GlyphCapacity = 0; Glyphs = null; GlyphVisualAttributes = null; GlyphAdvanceWidths = null; GlyphOffsets = null; }
public static extern int ScriptPlace( [In] IntPtr hdc, [In, Out] ref IntPtr psc, [In] ushort *pwGlyphs, [In] int cGlyphs, [In] SCRIPT_VISATTR *psva, [In, Out] SCRIPT_ANALYSIS *psa, [Out] int *piAdvance, [Out] GOFFSET *pGoffset, [Out] out ABC pABC);
public static extern int ScriptTextOut( [In] IntPtr hdc, [In, Out] ref IntPtr psc, [In] int x, [In] int y, [In] ExtTextOutOptions fuOptions, [In] RECT *lprc, [In] SCRIPT_ANALYSIS *psa, [In] char *pwcReserved, [In] int iReserved, [In] ushort *pwGlyphs, [In] int cGlyphs, [In] int *piAdvance, [In] int *piJustify, [In] GOFFSET *pGoffset);
private void ReAllocGlyphBuffers(int newGlyphCapacity) { Glyphs = (ushort*)Memory.ReAlloc(Glyphs, newGlyphCapacity * sizeof(ushort)); GlyphVisualAttributes = (SCRIPT_VISATTR*)Memory.ReAlloc(GlyphVisualAttributes, newGlyphCapacity * sizeof(SCRIPT_VISATTR)); GlyphAdvanceWidths = (int*)Memory.ReAlloc(GlyphAdvanceWidths, newGlyphCapacity * sizeof(int)); GlyphOffsets = (GOFFSET*)Memory.ReAlloc(GlyphOffsets, newGlyphCapacity * sizeof(GOFFSET)); }