diff --git a/Source/SharpFontShared/FT.Internal.cs b/Source/SharpFontShared/FT.Internal.cs index db755e8..4a40dad 100644 --- a/Source/SharpFontShared/FT.Internal.cs +++ b/Source/SharpFontShared/FT.Internal.cs @@ -1,5 +1,5 @@ #region MIT License -/*Copyright (c) 2012-2015 Robert Rouhani +/*Copyright (c) 2012-2016 Robert Rouhani SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team @@ -292,10 +292,10 @@ public static partial class FT internal static extern bool FT_Has_PS_Glyph_Names(IntPtr face); [DllImport(FreetypeDll, CallingConvention = CallConvention)] - internal static extern Error FT_Get_PS_Font_Info(IntPtr face, out IntPtr afont_info); + internal static extern Error FT_Get_PS_Font_Info(IntPtr face, out PostScript.Internal.FontInfoRec afont_info); [DllImport(FreetypeDll, CallingConvention = CallConvention)] - internal static extern Error FT_Get_PS_Font_Private(IntPtr face, out IntPtr afont_private); + internal static extern Error FT_Get_PS_Font_Private(IntPtr face, out PostScript.Internal.PrivateRec afont_private); [DllImport(FreetypeDll, CallingConvention = CallConvention)] internal static extern int FT_Get_PS_Font_Value(IntPtr face, DictionaryKeys key, uint idx, ref IntPtr value, int value_len); @@ -308,7 +308,7 @@ public static partial class FT internal static extern uint FT_Get_Sfnt_Name_Count(IntPtr face); [DllImport(FreetypeDll, CallingConvention = CallConvention)] - internal static extern Error FT_Get_Sfnt_Name(IntPtr face, uint idx, out IntPtr aname); + internal static extern Error FT_Get_Sfnt_Name(IntPtr face, uint idx, out TrueType.Internal.SfntNameRec aname); #endregion diff --git a/Source/SharpFontShared/Face.cs b/Source/SharpFontShared/Face.cs index a7cf32e..e816a9e 100644 --- a/Source/SharpFontShared/Face.cs +++ b/Source/SharpFontShared/Face.cs @@ -1794,13 +1794,13 @@ public bool HasPSGlyphNames() /// Output font info structure pointer. public FontInfo GetPSFontInfo() { - IntPtr fontInfoRef; - Error err = FT.FT_Get_PS_Font_Info(Reference, out fontInfoRef); + PostScript.Internal.FontInfoRec fontInfoRec; + Error err = FT.FT_Get_PS_Font_Info(Reference, out fontInfoRec); if (err != Error.Ok) throw new FreeTypeException(err); - return new FontInfo(fontInfoRef); + return new FontInfo(fontInfoRec); } /// @@ -1816,13 +1816,13 @@ public FontInfo GetPSFontInfo() /// Output private dictionary structure pointer. public Private GetPSFontPrivate() { - IntPtr privateRef; - Error err = FT.FT_Get_PS_Font_Private(Reference, out privateRef); + PostScript.Internal.PrivateRec privateRec; + Error err = FT.FT_Get_PS_Font_Private(Reference, out privateRec); if (err != Error.Ok) throw new FreeTypeException(err); - return new Private(privateRef); + return new Private(privateRec); } /// @@ -1895,14 +1895,14 @@ public uint GetSfntNameCount() [CLSCompliant(false)] public SfntName GetSfntName(uint idx) { - IntPtr nameRef; + TrueType.Internal.SfntNameRec nameRec; - Error err = FT.FT_Get_Sfnt_Name(Reference, idx, out nameRef); + Error err = FT.FT_Get_Sfnt_Name(Reference, idx, out nameRec); if (err != Error.Ok) throw new FreeTypeException(err); - return new SfntName(nameRef); + return new SfntName(nameRec); } #endregion diff --git a/Source/SharpFontShared/PostScript/FaceDict.cs b/Source/SharpFontShared/PostScript/FaceDict.cs index c894c07..4f965b6 100644 --- a/Source/SharpFontShared/PostScript/FaceDict.cs +++ b/Source/SharpFontShared/PostScript/FaceDict.cs @@ -1,5 +1,5 @@ #region MIT License -/*Copyright (c) 2012-2013 Robert Rouhani +/*Copyright (c) 2012-2013, 2016 Robert Rouhani SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team @@ -59,7 +59,7 @@ public Private PrivateDictionary { get { - return new Private(reference); + return new Private(rec.private_dict); } } diff --git a/Source/SharpFontShared/PostScript/FaceInfo.cs b/Source/SharpFontShared/PostScript/FaceInfo.cs index 1993eb3..731a4b7 100644 --- a/Source/SharpFontShared/PostScript/FaceInfo.cs +++ b/Source/SharpFontShared/PostScript/FaceInfo.cs @@ -1,5 +1,5 @@ #region MIT License -/*Copyright (c) 2012-2013 Robert Rouhani +/*Copyright (c) 2012-2013, 2016 Robert Rouhani SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team @@ -115,7 +115,7 @@ public FontInfo FontInfo { get { - return new FontInfo(PInvokeHelper.AbsoluteOffsetOf(Reference, "font_info")); + return new FontInfo(rec.font_info); } } diff --git a/Source/SharpFontShared/PostScript/FontInfo.cs b/Source/SharpFontShared/PostScript/FontInfo.cs index eb24ec3..7fd8792 100644 --- a/Source/SharpFontShared/PostScript/FontInfo.cs +++ b/Source/SharpFontShared/PostScript/FontInfo.cs @@ -1,5 +1,5 @@ #region MIT License -/*Copyright (c) 2012-2013 Robert Rouhani +/*Copyright (c) 2012-2013, 2016 Robert Rouhani SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team @@ -37,16 +37,15 @@ public class FontInfo { #region Fields - private IntPtr reference; private FontInfoRec rec; #endregion #region Constructors - internal FontInfo(IntPtr reference) + internal FontInfo(FontInfoRec rec) { - Reference = reference; + this.rec = rec; } #endregion @@ -153,20 +152,6 @@ public ushort UnderlineThickness } } - internal IntPtr Reference - { - get - { - return reference; - } - - set - { - reference = value; - rec = PInvokeHelper.PtrToStructure(reference); - } - } - #endregion } } diff --git a/Source/SharpFontShared/PostScript/Private.cs b/Source/SharpFontShared/PostScript/Private.cs index fcddcbb..a846d58 100644 --- a/Source/SharpFontShared/PostScript/Private.cs +++ b/Source/SharpFontShared/PostScript/Private.cs @@ -1,5 +1,5 @@ #region MIT License -/*Copyright (c) 2012-2013 Robert Rouhani +/*Copyright (c) 2012-2013, 2016 Robert Rouhani SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team @@ -37,16 +37,15 @@ public class Private { #region Fields - private IntPtr reference; private PrivateRec rec; #endregion #region Constructors - internal Private(IntPtr reference) + internal Private(PrivateRec rec) { - Reference = reference; + this.rec = rec; } #endregion @@ -342,20 +341,6 @@ public short[] MinFeature } } - internal IntPtr Reference - { - get - { - return reference; - } - - set - { - reference = value; - rec = PInvokeHelper.PtrToStructure(reference); - } - } - #endregion } } diff --git a/Source/SharpFontShared/TrueType/SfntName.cs b/Source/SharpFontShared/TrueType/SfntName.cs index 2ed7d0a..2697054 100644 --- a/Source/SharpFontShared/TrueType/SfntName.cs +++ b/Source/SharpFontShared/TrueType/SfntName.cs @@ -1,5 +1,5 @@ #region MIT License -/*Copyright (c) 2012-2013 Robert Rouhani +/*Copyright (c) 2012-2013, 2016 Robert Rouhani SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team @@ -44,16 +44,15 @@ public class SfntName { #region Fields - private IntPtr reference; private SfntNameRec rec; #endregion #region Constructors - internal SfntName(IntPtr reference) + internal SfntName(SfntNameRec rec) { - Reference = reference; + this.rec = rec; } #endregion @@ -125,20 +124,6 @@ public string String } } - internal IntPtr Reference - { - get - { - return reference; - } - - set - { - reference = value; - rec = PInvokeHelper.PtrToStructure(reference); - } - } - #endregion } }