|
- unit ultsChar;
-
- {$mode objfpc}{$H+}
-
- interface
-
- uses
- Classes, SysUtils,
- utsTextSuite, ultsTypes;
-
- function ltsCharGetCharCode (aHandle: TltsCharHandle; out aValue: WideChar): TltsErrorCode; stdcall;
- function ltsCharGetGlyphMetric(aHandle: TltsCharHandle; out aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
- function ltsCharSetGlyphMetric(aHandle: TltsCharHandle; aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
-
- implementation
-
- uses
- ultsUtils;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //ltsChar///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function ltsCharGetCharCode(aHandle: TltsCharHandle; out aValue: WideChar): TltsErrorCode; stdcall;
- var
- c: TtsChar;
- begin
- try
- result := ltsErrNone;
- if CheckCharHandle(aHandle, c)
- then aValue := c.CharCode
- else result := LastErrorCode;
- except
- on ex: Exception do begin
- SetLastError(ex);
- result := LastErrorCode;
- end;
- end;
- end;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function ltsCharGetGlyphMetric(aHandle: TltsCharHandle; out aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
- var
- c: TtsChar;
- begin
- try
- result := ltsErrNone;
- if CheckCharHandle(aHandle, c)
- then aValue := c.GlyphMetric
- else result := LastErrorCode;
- except
- on ex: Exception do begin
- SetLastError(ex);
- result := LastErrorCode;
- end;
- end;
- end;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function ltsCharSetGlyphMetric(aHandle: TltsCharHandle; aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
- var
- c: TtsChar;
- begin
- try
- result := ltsErrNone;
- if CheckCharHandle(aHandle, c)
- then c.GlyphMetric := aValue
- else result := LastErrorCode;
- except
- on ex: Exception do begin
- SetLastError(ex);
- result := LastErrorCode;
- end;
- end;
- end;
-
- end.
|