externLibs.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // System.Drawing.Text.XrImpl.externLibs.cs
  3. //
  4. // Author:
  5. // Alexandre Pigolkine ([email protected])
  6. //
  7. //
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Text;
  11. namespace System.Drawing.Text {
  12. namespace XrImpl {
  13. [StructLayout(LayoutKind.Sequential)]
  14. internal struct FcFontSet {
  15. internal int nfont;
  16. internal int sfont;
  17. internal IntPtr fonts; // FcPattern **fonts;
  18. }
  19. internal enum FcResult : int {
  20. FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, FcResultNoId
  21. }
  22. class Xft {
  23. const string XftImp = "Xft";
  24. [DllImport(XftImp, EntryPoint="XftListFonts")]
  25. internal static extern IntPtr XftListFontFamilies (IntPtr dpy, int screen, int zero1, IntPtr FC_FAMILY_PTR, int zero2 );
  26. }
  27. class Fontconfig {
  28. const string FontconfigImp = "fontconfig";
  29. internal static string FC_FAMILY = "family";
  30. internal static IntPtr FC_FAMILY_PTR;
  31. static Fontconfig() {
  32. FC_FAMILY_PTR = Marshal.StringToHGlobalAnsi(FC_FAMILY);
  33. }
  34. [DllImport(FontconfigImp, CharSet = CharSet.Ansi)]
  35. internal static extern int FcPatternGetString(IntPtr fcPattern, IntPtr obj, int n, ref IntPtr val);
  36. [DllImport(FontconfigImp, CharSet = CharSet.Ansi)]
  37. internal static extern int FcPatternGetString(int fcPattern, IntPtr obj, int n, ref IntPtr val);
  38. }
  39. }
  40. }