public void Justify(Slot start, Font font, double width, JustFlags flags, Slot first, Slot last) { IntPtr firstPtr = first != null ? first.SlotPtr : IntPtr.Zero; IntPtr lastPtr = last != null ? last.SlotPtr : IntPtr.Zero; Graphite2Api.SegJustify(_segment, start.SlotPtr, font.FontPtr, width, flags, firstPtr, lastPtr); }
public FeatureRef FindFref(Int32 featid) { IntPtr ptr = Graphite2Api.FaceFindFref(_face, featid); if (ptr == IntPtr.Zero) { return(null); } return(new FeatureRef(ptr)); }
public FeatureRef Fref(UInt16 i) { IntPtr ptr = Graphite2Api.FaceFref(_face, i); if (ptr == IntPtr.Zero) { return(null); } return(new FeatureRef(ptr)); }
public string ValueLabel(UInt16 settingsno, string langid, Encform utf) { UInt32 length; ushort langId = (ushort)Graphite2Api.StrToTag(langid); IntPtr labelPtr = Graphite2Api.FrefValueLabel(_featureRef, settingsno, ref langId, utf, out length); string retLabel = ConvertGraphiteLabelToString(labelPtr, utf, length); Graphite2Api.LabelDestroy(labelPtr); return(retLabel); }
public Featureval FeaturevalForLang(string lang) { IntPtr ptr = Graphite2Api.FaceFeaturevalForLang(_face, Graphite2Api.StrToTag(lang)); if (ptr == IntPtr.Zero) { return(null); } return(new Featureval(ptr)); }
public Segment MakeSeg(UInt32 script, Featureval feats, string str, Bidirtl dir) { IntPtr strPtr = Marshal.StringToCoTaskMemUni(str); IntPtr error = new IntPtr(0); int numCodePoints = Graphite2Api.CountUnicodeCharacters(Encform.Utf16, strPtr, IntPtr.Zero, ref error); IntPtr segmentPtr = Graphite2Api.MakeSeg(_font, _face.FacePtr, script, feats.FeatureValPtr, Encform.Utf16, strPtr, numCodePoints, dir); Marshal.FreeCoTaskMem(strPtr); return(new Segment(segmentPtr)); }
public CharInfo Cinfo(uint index) { IntPtr charInfoPtr = Graphite2Api.SegCinfo(_segment, index); if (charInfoPtr == IntPtr.Zero) { return(null); } return(new CharInfo(charInfoPtr)); }
public bool StartLogging(string filename) { int major, minor, bugfix; Graphite2Api.EngineVersion(out major, out minor, out bugfix); if (major <= 1 && minor < 2) { throw new NotSupportedException("A newer graphite engine is needed to support logging"); } return(Graphite2Api.StartLogging(_face, filename)); }
public void StopLogging() { int major, minor, bugfix; Graphite2Api.EngineVersion(out major, out minor, out bugfix); if (major <= 1 && minor < 2) { throw new NotSupportedException("A newer graphite engine is needed to support logging"); } Graphite2Api.StopLogging(_face); }
public Face(string filename, uint segCacheMaxSize, FaceOptions options) { if (!File.Exists(filename)) { throw new ArgumentException("filename"); } _face = Graphite2Api.MakeFileFaceWithSegCache(filename, segCacheMaxSize, options); if (_face == IntPtr.Zero) { throw new ArgumentException("filename is not a graphite font"); } }
public string Label(string langid, Encform utf) { UInt32 length; ushort langId = (ushort)Graphite2Api.StrToTag(langid); IntPtr labelPtr = Graphite2Api.FrefLabel(_featureRef, ref langId, utf, out length); if (labelPtr == IntPtr.Zero) { return(String.Empty); } string retLabel = ConvertGraphiteLabelToString(labelPtr, utf, length); Graphite2Api.LabelDestroy(labelPtr); return(retLabel); }
/// <summary> /// Determins if filename is a graphite font or not. /// </summary> public static bool IsGraphiteFont(string filename) { if (!File.Exists(filename)) { return(false); } IntPtr face = Graphite2Api.MakeFileFace(filename, FaceOptions.face_default); if (face == IntPtr.Zero) { return(false); } Graphite2Api.FaceDestroy(face); return(true); }
public void Dispose() { Graphite2Api.FaceDestroy(_face); }
public void Dispose() { Graphite2Api.FontDestroy(_font); }
public UInt16 NValues() { return(Graphite2Api.FrefNValues(_featureRef)); }
public void Dispose() { Graphite2Api.SegDestroy(_segment); }
public UInt32 LangByIndex(UInt16 i) { return(Graphite2Api.FaceLangByIndex(_face, i)); }
public short NGlyphs() { return(Graphite2Api.FaceNGlyphs(_face)); }
public void Dispose() { Graphite2Api.FeatureValDestroy(_featureval); }
public ushort NLanguages() { return(Graphite2Api.FaceNLanguages(_face)); }
public UInt16 Value(UInt16 settingno) { return(Graphite2Api.FrefValue(_featureRef, settingno)); }
public UInt16 FeatureValue(Featureval feats) { return(Graphite2Api.FrefFeatureValue(_featureRef, feats.FeatureValPtr)); }
public UInt16 NFref() { return(Graphite2Api.FaceNFref(_face)); }
public float AdvanceY(Face face, Font font) { return(Graphite2Api.SlotAdvanceY(_slot, face.FacePtr, font.FontPtr)); }
public int SetFeatureValue(UInt16 val, Featureval dest) { return(Graphite2Api.FrefSetFeatureValue(_featureRef, val, dest.FeatureValPtr)); }
public int Attr(Segment seg, AttrCode index, byte subindex) { return(Graphite2Api.SlotAttr(_slot, seg.SegPtr, index, subindex)); }
public Featureval Clone() { return(new Featureval(Graphite2Api.FeaturevalClone(_featureval))); }
public void LineBreakBefore() { Graphite2Api.SlotLinebreakBefore(_slot); }
public Font(float ppm, Face face) { _face = face; _font = Graphite2Api.MakeFont(ppm, _face.FacePtr); }