Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 

78 wiersze
2.4 KiB

  1. unit ultsChar;
  2. {$mode objfpc}{$H+}
  3. interface
  4. uses
  5. Classes, SysUtils,
  6. utsTextSuite, ultsTypes;
  7. function ltsCharGetCharCode (aHandle: TltsCharHandle; out aValue: WideChar): TltsErrorCode; stdcall;
  8. function ltsCharGetGlyphMetric(aHandle: TltsCharHandle; out aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
  9. function ltsCharSetGlyphMetric(aHandle: TltsCharHandle; aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
  10. implementation
  11. uses
  12. ultsUtils;
  13. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  14. //ltsChar///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  15. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  16. function ltsCharGetCharCode(aHandle: TltsCharHandle; out aValue: WideChar): TltsErrorCode; stdcall;
  17. var
  18. c: TtsChar;
  19. begin
  20. try
  21. result := ltsErrNone;
  22. if CheckCharHandle(aHandle, c)
  23. then aValue := c.CharCode
  24. else result := LastErrorCode;
  25. except
  26. on ex: Exception do begin
  27. SetLastError(ex);
  28. result := LastErrorCode;
  29. end;
  30. end;
  31. end;
  32. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  33. function ltsCharGetGlyphMetric(aHandle: TltsCharHandle; out aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
  34. var
  35. c: TtsChar;
  36. begin
  37. try
  38. result := ltsErrNone;
  39. if CheckCharHandle(aHandle, c)
  40. then aValue := c.GlyphMetric
  41. else result := LastErrorCode;
  42. except
  43. on ex: Exception do begin
  44. SetLastError(ex);
  45. result := LastErrorCode;
  46. end;
  47. end;
  48. end;
  49. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  50. function ltsCharSetGlyphMetric(aHandle: TltsCharHandle; aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
  51. var
  52. c: TtsChar;
  53. begin
  54. try
  55. result := ltsErrNone;
  56. if CheckCharHandle(aHandle, c)
  57. then c.GlyphMetric := aValue
  58. else result := LastErrorCode;
  59. except
  60. on ex: Exception do begin
  61. SetLastError(ex);
  62. result := LastErrorCode;
  63. end;
  64. end;
  65. end;
  66. end.