Updated to MonoGame 3.6 + Directory refactor

- Barotrauma's projects are in the Barotrauma directory
- All libraries are in the Libraries directory
- MonoGame is now managed by NuGet, rather than referenced from the installed files (TODO: consider using PCL for easier cross-platform development?)
- NuGet libraries are not included in the repo, as getting the latest versions automatically should be preferred
- Removed Content/effects.mgfx as it didn't seem to be used anywhere
- Removed some references to Subsurface directory
- Renamed Launcher2 to Launcher
This commit is contained in:
juanjp600
2017-06-27 09:52:57 -03:00
parent 330b24bcf6
commit 4d225c65f2
1301 changed files with 169 additions and 77952 deletions

View File

@@ -0,0 +1,105 @@
#region MIT License
/*Copyright (c) 2012-2013 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
namespace SharpFont.PostScript
{
/// <summary>
/// A set of flags used to indicate which fields are present in a given blend dictionary (font info or private).
/// Used to support Multiple Masters fonts.
/// </summary>
public enum BlendFlags
{
/// <summary>
/// The position of the underline stroke.
/// </summary>
UnderlinePosition = 0,
/// <summary>
/// The thickness of the underline stroke.
/// </summary>
UnderlineThickness,
/// <summary>
/// The angle of italics.
/// </summary>
ItalicAngle,
/// <summary>
/// Set if the font contains BlueValues.
/// </summary>
BlueValues,
/// <summary>
/// Set if the font contains OtherBlues.
/// </summary>
OtherBlues,
/// <summary>
/// Set if the font contains StandardWidth values.
/// </summary>
StandardWidth,
/// <summary>
/// Set if the font contains StandardHeight values.
/// </summary>
StandardHeight,
/// <summary>
/// Set if the font contains StemSnapWidths.
/// </summary>
StemSnapWidths,
/// <summary>
/// Set if the font contains StemSnapHeights.
/// </summary>
StemSnapHeights,
/// <summary>
/// Set if the font contains BlueScale values.
/// </summary>
BlueScale,
/// <summary>
/// Set if the font contains BlueShift values.
/// </summary>
BlueShift,
/// <summary>
/// Set if the font contains FamilyBlues values.
/// </summary>
FamilyBlues,
/// <summary>
/// Set if the font contains FamilyOtherBlues values.
/// </summary>
FamilyOtherBlues,
/// <summary>
/// Force bold blending.
/// </summary>
ForceBold
}
}

View File

@@ -0,0 +1,271 @@
#region MIT License
/*Copyright (c) 2012-2013 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
namespace SharpFont.PostScript
{
/// <summary>
/// An enumeration used in calls to <see cref="Face.GetPSFontValue"/> to identify the Type 1 dictionary entry to
/// retrieve.
/// </summary>
/// <see href="http://partners.adobe.com/public/developer/en/font/T1_SPEC.PDF"/>
public enum DictionaryKeys
{
/// <summary>
/// The font's type. Type 1 fonts must have a value of 1.
/// </summary>
FontType,
/// <summary>
/// The font's matrix. Typically scaled 1000:1.
/// </summary>
FontMatrix,
/// <summary>
/// The font's general bounding box.
/// </summary>
FontBBox,
/// <summary>
/// The font's method of painting characters. Type 1 only supports fill (0) and outline (2).
/// </summary>
PaintType,
/// <summary>
/// The font's name.
/// </summary>
FontName,
/// <summary>
/// A unique identifier for popular fonts assigned by Adobe.
/// </summary>
UniqueId,
/// <summary>
/// The number of characters the font can draw.
/// </summary>
NumCharStrings,
/// <summary>
/// The char string key.
/// </summary>
CharStringKey,
/// <summary>
/// The char string entry.
/// </summary>
CharString,
/// <summary>
/// The font's encoding type.
/// </summary>
EncodingType,
/// <summary>
/// The font's encoding entry.
/// </summary>
EncodingEntry,
/// <summary>
/// The number of charstring subroutines in the font.
/// </summary>
NumSubrs,
/// <summary>
/// The font's subroutines.
/// </summary>
Subr,
/// <summary>
/// An array with only one real number entry expressing the dominant width of horizontal stems (measured
/// vertically in character space units).
/// </summary>
StdHW,
/// <summary>
/// An array with only one real number entry expressing the dominant width of vertical stems (measured
/// horizontally in character space units).
/// </summary>
StdVW,
/// <summary>
/// The number of BlueValues the font defines. The value must be at least 0 and at most 14. (7 integer pairs).
/// </summary>
NumBlueValues,
/// <summary>
/// An array of integer pairs. The first pair must be the base overshoot position and the base-line.
/// </summary>
BlueValue,
/// <summary>
/// An optional entry that specifies the number of character space units to extend (in both directions) the
/// effect of an alignment zone on a horizontal stem. The default value is 1.
/// </summary>
BlueFuzz,
/// <summary>
/// The number of OtherBlue values. The value must be at least 0 and at most 10 (5 integer pairs).
/// </summary>
NumOtherBlues,
/// <summary>
/// An optional array of integer pairs very similar to those in <see cref="BlueValue"/>.
/// </summary>
OtherBlue,
/// <summary>
/// The number of FamilyBlue values.
/// </summary>
NumFamilyBlues,
/// <summary>
/// An array of integer pairs very similar to those in <see cref="BlueValue"/>.
/// </summary>
FamilyBlue,
/// <summary>
/// The number of FamilyOtherBlue values.
/// </summary>
NumFamilyOtherBlues,
/// <summary>
/// An array of integer pairs very similar to those in <see cref="OtherBlue"/>.
/// </summary>
FamilyOtherBlue,
/// <summary>
/// An optional entry that controls the point size at which overshoot suppression ceases. The default value is
/// 0.039625.
/// </summary>
BlueScale,
/// <summary>
/// An optional entry that indicates a character space distance beyond the flat position of alignment zones at
/// which overshoot enforcement for character features occurs. The default value is 7.
/// </summary>
BlueShift,
/// <summary>
/// The number of StemSnapH values. Cannot exceed 12.
/// </summary>
NumStemSnapH,
/// <summary>
/// An array of up to 12 real numbers of the most common widths (including the dominant width given in the
/// StdHW array) for horizontal stems (measured vertically). These widths must be sorted in increasing order.
/// </summary>
StemSnapH,
/// <summary>
/// The number of StemSnapV values. Cannot exceed 12.
/// </summary>
NumStemSnapV,
/// <summary>
/// An array of up to 12 real numbers of the most common widths (including the dominant width given in the
/// StdVW array) for vertical stems (measured horizontally). These widths must be sorted in increasing order.
/// </summary>
StemSnapV,
/// <summary>
/// A boolean value indicating whether to force bold characters when a regular character is drawn 1-pixel wide.
/// </summary>
ForceBold,
/// <summary>
/// Compatibility entry. Use only for font programs in language group 1.
/// </summary>
RndStemUp,
/// <summary>
/// Obsolete. Set to {16 16}. Required.
/// </summary>
MinFeature,
/// <summary>
/// An integer specifying the number of random bytes at the beginning of charstrings for encryption. By default
/// this value is 4.
/// </summary>
LenIV,
/// <summary>
/// Compatibility entry. Set to 5839.
/// </summary>
Password,
/// <summary>
/// Identifies the language group of the font. A value of 0 indicates a language that uses Latin, Greek,
/// Cyrillic, etc. characters. A value of 1 indicates a language that consists of Chinese ideographs, Jpaanese
/// Kanji, and Korean Hangul. The default value is 0.
/// </summary>
LanguageGroup,
/// <summary>
/// The version identifier for this font.
/// </summary>
Version,
/// <summary>
/// The copyright notice of the font.
/// </summary>
Notice,
/// <summary>
/// The fullname of the font.
/// </summary>
FullName,
/// <summary>
/// The family name of the font.
/// </summary>
FamilyName,
/// <summary>
/// The name of the weight of the font.
/// </summary>
Weight,
/// <summary>
/// Whether the font is fixed pitch.
/// </summary>
IsFixedPitch,
/// <summary>
/// The position of the underline stroke.
/// </summary>
UnderlinePosition,
/// <summary>
/// What types of embedding and usages are allowed.
/// </summary>
FSType,
/// <summary>
/// The italic angle.
/// </summary>
ItalicAngle
}
}

View File

@@ -0,0 +1,55 @@
#region MIT License
/*Copyright (c) 2012-2013 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
namespace SharpFont.PostScript
{
/// <summary>
/// An enumeration describing the Encoding entry in a Type 1 dictionary.
/// </summary>
public enum EncodingType
{
/// <summary>
/// Not encoded.
/// </summary>
None = 0,
/// <summary>
/// Array encoding.
/// </summary>
Array,
/// <summary>
/// Standard encoding.
/// </summary>
Standard,
/// <summary>
/// ISO Latin 1 encoding.
/// </summary>
IsoLatin1,
/// <summary>
/// Expert encoding.
/// </summary>
Expert
}
}

View File

@@ -0,0 +1,209 @@
#region MIT License
/*Copyright (c) 2012-2013, 2016 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using SharpFont.PostScript.Internal;
namespace SharpFont.PostScript
{
/// <summary>
/// A structure used to represent data in a CID top-level dictionary.
/// </summary>
public class FaceDict
{
#region Fields
private IntPtr reference;
private FaceDictRec rec;
#endregion
#region Constructors
internal FaceDict(IntPtr reference)
{
Reference = reference;
}
#endregion
#region Properties
/// <summary>
/// Gets the Private structure containing more information.
/// </summary>
public Private PrivateDictionary
{
get
{
return new Private(rec.private_dict);
}
}
/// <summary>
/// Gets the length of the BuildChar entry.
/// </summary>
[CLSCompliant(false)]
public uint BuildCharLength
{
get
{
return rec.len_buildchar;
}
}
/// <summary>
/// Gets whether to force bold characters when a regular character has
/// strokes drawn 1-pixel wide.
/// </summary>
public int ForceBoldThreshold
{
get
{
return (int)rec.forcebold_threshold;
}
}
/// <summary>
/// Gets the width of stroke.
/// </summary>
public int StrokeWidth
{
get
{
return (int)rec.stroke_width;
}
}
/// <summary>
/// Gets hinting useful for rendering glyphs such as barcodes and logos that
/// have many counters.
/// </summary>
public int ExpansionFactor
{
get
{
return (int)rec.expansion_factor;
}
}
/// <summary>
/// Gets the method for painting strokes (fill or outline).
/// </summary>
public byte PaintType
{
get
{
return rec.paint_type;
}
}
/// <summary>
/// Gets the type of font. Must be set to 1 for all Type 1 fonts.
/// </summary>
public byte FontType
{
get
{
return rec.font_type;
}
}
/// <summary>
/// Gets the matrix that indicates scaling of space units.
/// </summary>
public FTMatrix FontMatrix
{
get
{
return rec.font_matrix;
}
}
/// <summary>
/// Gets the offset of the font.
/// </summary>
public FTVector FontOffset
{
get
{
return rec.font_offset;
}
}
/// <summary>
/// Gets the number of subroutines.
/// </summary>
[CLSCompliant(false)]
public uint SubrsCount
{
get
{
return rec.num_subrs;
}
}
/// <summary>
/// Gets the offset in bytes, from the start of the
/// data section of the CIDFont to the beginning of the SubrMap.
/// </summary>
[CLSCompliant(false)]
public uint SubrmapOffset
{
get
{
return (uint)rec.subrmap_offset;
}
}
/// <summary>
/// Gets the number of bytes needed to store the SD value.
/// </summary>
public int SDBytes
{
get
{
return rec.sd_bytes;
}
}
internal IntPtr Reference
{
get
{
return reference;
}
set
{
reference = value;
rec = PInvokeHelper.PtrToStructure<FaceDictRec>(reference);
}
}
#endregion
}
}

View File

@@ -0,0 +1,267 @@
#region MIT License
/*Copyright (c) 2012-2013, 2016 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Linq;
using System.Runtime.InteropServices;
using SharpFont.PostScript.Internal;
namespace SharpFont.PostScript
{
/// <summary>
/// A structure used to represent CID Face information.
/// </summary>
public class FaceInfo
{
#region Fields
private IntPtr reference;
private FaceInfoRec rec;
#endregion
#region Constructors
internal FaceInfo(IntPtr reference)
{
Reference = reference;
}
#endregion
#region Properties
/// <summary>
/// The name of the font, usually condensed from FullName.
/// </summary>
public string CidFontName
{
get
{
return rec.cid_font_name;
}
}
/// <summary>
/// The version number of the font.
/// </summary>
public int CidVersion
{
get
{
return (int)rec.cid_version;
}
}
/// <summary>
/// Gets the string identifying the font's manufacturer.
/// </summary>
public string Registry
{
get
{
return rec.registry;
}
}
/// <summary>
/// Gets the unique identifier for the character collection.
/// </summary>
public string Ordering
{
get
{
return rec.ordering;
}
}
/// <summary>
/// Gets the identifier (supplement number) of the character collection.
/// </summary>
public int Supplement
{
get
{
return rec.supplement;
}
}
/// <summary>
/// Gets the dictionary of font info that is not used by the PostScript interpreter.
/// </summary>
public FontInfo FontInfo
{
get
{
return new FontInfo(rec.font_info);
}
}
/// <summary>
/// Gets the coordinates of the corners of the bounding box.
/// </summary>
public BBox FontBBox
{
get
{
return rec.font_bbox;
}
}
/// <summary>
/// Gets the value to form UniqueID entries for base fonts within a composite font.
/// </summary>
[CLSCompliant(false)]
public uint UidBase
{
get
{
return (uint)rec.uid_base;
}
}
/// <summary>
/// Gets the number of entries in the XUID array.
/// </summary>
public int XuidCount
{
get
{
return rec.num_xuid;
}
}
/// <summary>
/// Gets the extended unique IDS that identify the form, which allows
/// the PostScript interpreter to cache the output for reuse.
/// </summary>
[CLSCompliant(false)]
public uint[] Xuid
{
get
{
return rec.xuid.Select(x => (uint)x).ToArray();
}
}
/// <summary>
/// Gets the offset in bytes to the charstring offset table.
/// </summary>
[CLSCompliant(false)]
public uint CidMapOffset
{
get
{
return (uint)rec.cidmap_offset;
}
}
/// <summary>
/// Gets the length in bytes of the FDArray index.
/// A value of 0 indicates that the charstring offset table doesn't contain
/// any FDArray indexes.
/// </summary>
public int FDBytes
{
get
{
return rec.fd_bytes;
}
}
/// <summary>
/// Gets the length of the offset to the charstring for each CID in the CID font.
/// </summary>
public int GDBytes
{
get
{
return rec.gd_bytes;
}
}
/// <summary>
/// Gets the number of valid CIDs in the CIDFont.
/// </summary>
[CLSCompliant(false)]
public uint CidCount
{
get
{
return (uint)rec.cid_count;
}
}
/// <summary>
/// Gets the number of entries in the FontDicts array.
/// </summary>
public int DictsCount
{
get
{
return rec.num_dicts;
}
}
/// <summary>
/// Gets the set of font dictionaries for this font.
/// </summary>
public FaceDict FontDicts
{
get
{
return new FaceDict(PInvokeHelper.AbsoluteOffsetOf<FaceInfoRec>(Reference, "font_dicts"));
}
}
/// <summary>
/// The offset of the data.
/// </summary>
[CLSCompliant(false)]
public uint DataOffset
{
get
{
return (uint)rec.data_offset;
}
}
internal IntPtr Reference
{
get
{
return reference;
}
set
{
reference = value;
rec = PInvokeHelper.PtrToStructure<FaceInfoRec>(reference);
}
}
#endregion
}
}

View File

@@ -0,0 +1,157 @@
#region MIT License
/*Copyright (c) 2012-2013, 2016 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using SharpFont.PostScript.Internal;
namespace SharpFont.PostScript
{
/// <summary>
/// A structure used to model a Type 1 or Type 2 FontInfo dictionary. Note that for Multiple Master fonts, each
/// instance has its own FontInfo dictionary.
/// </summary>
public class FontInfo
{
#region Fields
private FontInfoRec rec;
#endregion
#region Constructors
internal FontInfo(FontInfoRec rec)
{
this.rec = rec;
}
#endregion
#region Properties
/// <summary>
/// The version of the font.
/// </summary>
public string Version
{
get
{
return rec.version;
}
}
/// <summary>
/// The copyright notice for the font.
/// </summary>
public string Notice
{
get
{
return rec.notice;
}
}
/// <summary>
/// Gets the font's full name.
/// </summary>
public string FullName
{
get
{
return rec.full_name;
}
}
/// <summary>
/// Gets the font's family name.
/// </summary>
public string FamilyName
{
get
{
return rec.family_name;
}
}
/// <summary>
/// Gets the weight description of the font
/// </summary>
public string Weight
{
get
{
return rec.weight;
}
}
/// <summary>
/// Gets italic angle of the font.
/// </summary>
public int ItalicAngle
{
get
{
return (int)rec.italic_angle;
}
}
/// <summary>
/// Gets whether the font is fixed pitch.
/// </summary>
public bool IsFixedPitch
{
get
{
return rec.is_fixed_pitch == 1;
}
}
/// <summary>
/// Gets the position of the underline.
/// </summary>
public short UnderlinePosition
{
get
{
return rec.underline_position;
}
}
/// <summary>
/// Gets the thickness of the underline stroke.
/// </summary>
[CLSCompliant(false)]
public ushort UnderlineThickness
{
get
{
return rec.underline_thickness;
}
}
#endregion
}
}

View File

@@ -0,0 +1,54 @@
#region MIT License
/*Copyright (c) 2012-2015 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using SharpFont.Internal;
using FT_Long = System.IntPtr;
using FT_ULong = System.UIntPtr;
namespace SharpFont.PostScript.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal struct FaceDictRec
{
internal PrivateRec private_dict;
internal uint len_buildchar;
internal FT_Long forcebold_threshold;
internal FT_Long stroke_width;
internal FT_Long expansion_factor;
internal byte paint_type;
internal byte font_type;
internal FTMatrix font_matrix;
internal FTVector font_offset;
internal uint num_subrs;
internal FT_ULong subrmap_offset;
internal int sd_bytes;
}
}

View File

@@ -0,0 +1,69 @@
#region MIT License
/*Copyright (c) 2012-2015 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using SharpFont.Internal;
using FT_Long = System.IntPtr;
using FT_ULong = System.UIntPtr;
namespace SharpFont.PostScript.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal struct FaceInfoRec
{
[MarshalAs(UnmanagedType.LPStr)]
internal string cid_font_name;
internal FT_Long cid_version;
internal int cid_font_type;
[MarshalAs(UnmanagedType.LPStr)]
internal string registry;
[MarshalAs(UnmanagedType.LPStr)]
internal string ordering;
internal int supplement;
internal FontInfoRec font_info;
internal BBox font_bbox;
internal FT_ULong uid_base;
internal int num_xuid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
internal FT_ULong[] xuid;
internal FT_ULong cidmap_offset;
internal int fd_bytes;
internal int gd_bytes;
internal FT_ULong cid_count;
internal int num_dicts;
internal IntPtr font_dicts;
internal FT_ULong data_offset;
}
}

View File

@@ -0,0 +1,56 @@
#region MIT License
/*Copyright (c) 2012-2015 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using FT_Long = System.IntPtr;
using FT_ULong = System.UIntPtr;
namespace SharpFont.PostScript.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal struct FontInfoRec
{
[MarshalAs(UnmanagedType.LPStr)]
internal string version;
[MarshalAs(UnmanagedType.LPStr)]
internal string notice;
[MarshalAs(UnmanagedType.LPStr)]
internal string full_name;
[MarshalAs(UnmanagedType.LPStr)]
internal string family_name;
[MarshalAs(UnmanagedType.LPStr)]
internal string weight;
internal FT_Long italic_angle;
internal byte is_fixed_pitch;
internal short underline_position;
internal ushort underline_thickness;
}
}

View File

@@ -0,0 +1,82 @@
#region MIT License
/*Copyright (c) 2012-2015 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using FT_Long = System.IntPtr;
using FT_ULong = System.UIntPtr;
namespace SharpFont.PostScript.Internal
{
[StructLayout(LayoutKind.Sequential)]
internal struct PrivateRec
{
internal int unique_id;
internal int lenIV;
internal byte num_blue_values;
internal byte num_other_blues;
internal byte num_family_blues;
internal byte num_family_other_blues;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
internal short[] blue_values;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
internal short[] other_blues;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
internal short[] family_blues;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
internal short[] family_other_blues;
internal FT_Long blue_scale;
internal int blue_shift;
internal int blue_fuzz;
internal ushort standard_width;
internal ushort standard_height;
internal byte num_snap_widths;
internal byte num_snap_heights;
internal byte force_bold;
internal byte round_stem_up;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)]
internal short[] snap_widths;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)]
internal short[] snap_heights;
internal FT_Long expansion_factor;
internal FT_Long language_group;
internal FT_Long password;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
internal short[] min_feature;
}
}

View File

@@ -0,0 +1,346 @@
#region MIT License
/*Copyright (c) 2012-2013, 2016 Robert Rouhani <robert.rouhani@gmail.com>
SharpFont based on Tao.FreeType, Copyright (c) 2003-2007 Tao Framework Team
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.*/
#endregion
using System;
using System.Runtime.InteropServices;
using SharpFont.PostScript.Internal;
namespace SharpFont.PostScript
{
/// <summary>
/// A structure used to model a Type 1 or Type 2 private dictionary. Note that for Multiple Master fonts, each
/// instance has its own Private dictionary.
/// </summary>
public class Private
{
#region Fields
private PrivateRec rec;
#endregion
#region Constructors
internal Private(PrivateRec rec)
{
this.rec = rec;
}
#endregion
#region Properties
/// <summary>
/// Gets the ID unique to the Type 1 font.
/// </summary>
public int UniqueId
{
get
{
return rec.unique_id;
}
}
/// <summary>
/// Gets the number of random bytes at the beginning of charstrings (for encryption).
/// </summary>
public int LenIV
{
get
{
return rec.lenIV;
}
}
/// <summary>
/// Gets the number of values (pairs) in the Blues array.
/// </summary>
public byte BlueValuesCount
{
get
{
return rec.num_blue_values;
}
}
/// <summary>
/// Gets the number of values (pairs) in the OtherBlues array.
/// </summary>
public byte OtherBluesCount
{
get
{
return rec.num_other_blues;
}
}
/// <summary>
/// Gets the number of values (pairs) in the FamilyBlues array.
/// </summary>
public byte FamilyBluesCount
{
get
{
return rec.num_family_blues;
}
}
/// <summary>
/// Gets the number of values (pairs) in the FamilyOtherBlues array.
/// </summary>
public byte FamilyOtherBluesCount
{
get
{
return rec.num_family_other_blues;
}
}
/// <summary>
/// Gets the pairs of blue values.
/// </summary>
public short[] BlueValues
{
get
{
return rec.blue_values;
}
}
/// <summary>
/// Gets the pairs of blue values.
/// </summary>
public short[] OtherBlues
{
get
{
return rec.other_blues;
}
}
/// <summary>
/// Gets the pairs of blue values.
/// </summary>
public short[] FamilyBlues
{
get
{
return rec.family_blues;
}
}
/// <summary>
/// Gets the pairs of blue values.
/// </summary>
public short[] FamilyOtherBlues
{
get
{
return rec.family_other_blues;
}
}
/// <summary>
/// Gets the point size at which overshoot suppression ceases.
/// </summary>
public int BlueScale
{
get
{
return (int)rec.blue_scale;
}
}
/// <summary>
/// Gets whether characters smaller than the size given by BlueScale
/// should have overshoots suppressed.
/// </summary>
public int BlueShift
{
get
{
return rec.blue_shift;
}
}
/// <summary>
/// Gets the number of character space units to extend the effect of an
/// alignment zone on a horizontal stem. Setting this to 0 is recommended
/// because it is unreliable.
/// </summary>
public int BlueFuzz
{
get
{
return rec.blue_fuzz;
}
}
/// <summary>
/// Indicates the standard stroke width of vertical stems.
/// </summary>
[CLSCompliant(false)]
public ushort StandardWidth
{
get
{
return rec.standard_width;
}
}
/// <summary>
/// Indicates the standard stroke width of horizontal stems.
/// </summary>
[CLSCompliant(false)]
public ushort StandardHeight
{
get
{
return rec.standard_height;
}
}
/// <summary>
/// Indicates the number of values in the SnapWidths array.
/// </summary>
public byte SnapWidthsCount
{
get
{
return rec.num_snap_widths;
}
}
/// <summary>
/// Indicates the number of values in the SnapHeights array.
/// </summary>
public byte SnapHeightsCount
{
get
{
return rec.num_snap_heights;
}
}
/// <summary>
/// Gets whether bold characters should appear thicker than non-bold characters
/// at very small point sizes, where otherwise bold characters might appear the
/// same as non-bold characters.
/// </summary>
public bool ForceBold
{
get
{
return rec.force_bold == 1;
}
}
/// <summary>
/// Superseded by the LanguageGroup entry.
/// </summary>
public bool RoundStemUp
{
get
{
return rec.round_stem_up == 1;
}
}
/// <summary>
/// StemSnapH is an array of up to 12 values of the most common stroke widths for horizontal stems
/// (measured vertically).
/// </summary>
public short[] SnapWidths
{
get
{
return rec.snap_widths;
}
}
/// <summary>
/// StemSnapV is an array of up to 12 values of the most common stroke widths for vertical stems
/// (measured horizontally).
/// </summary>
public short[] SnapHeights
{
get
{
return rec.snap_heights;
}
}
/// <summary>
/// The Expansion Factor provides a limit for changing character bounding boxes during
/// processing that adjusts the size of fonts of Language Group 1.
/// </summary>
public int ExpansionFactor
{
get
{
return (int)rec.expansion_factor;
}
}
/// <summary>
/// Indicates the aesthetic characteristics of the font. Currently, only LanguageGroup 0
/// (e.g. Latin, Greek, Cyrillic, etc.) and LanguageGroup 1 (e.g. Chinese ideographs, Japanese
/// Kanji, etc) are recognized.
/// </summary>
public int LanguageGroup
{
get
{
return (int)rec.language_group;
}
}
/// <summary>
/// The Password value is required for the Type 1 BuildChar to operate.
/// It must be set to 5839.
/// </summary>
public int Password
{
get
{
return (int)rec.password;
}
}
/// <summary>
/// The MinFeature value is required for the Type 1 BuildChar to operate, but is obsolete.
/// It must be set to {16,16}.
/// </summary>
public short[] MinFeature
{
get
{
return rec.min_feature;
}
}
#endregion
}
}