|
- 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; constref aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
-
- implementation
-
- uses
- ultsUtils{$IFDEF DEBUG}, uutlLogger{$ENDIF};
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //ltsChar///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function ltsCharGetCharCode(aHandle: TltsCharHandle; out aValue: WideChar): TltsErrorCode; stdcall;
- var
- c: TtsChar;
- begin
- try
- {$IFDEF DEBUG}utlLogger.log(nil, 'ltsCharGetCharCode(Handle=%p; Value=%p)', [Pointer(aHandle), Pointer(@aValue)]);{$ENDIF}
- 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;
- {$IFDEF DEBUG}utlLogger.log(nil, 'ltsCharGetCharCode=%d', [Integer(result)]);{$ENDIF}
- end;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function ltsCharGetGlyphMetric(aHandle: TltsCharHandle; out aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
- var
- c: TtsChar;
- begin
- try
- {$IFDEF DEBUG}utlLogger.log(nil, 'ltsCharGetGlyphMetric(Handle=%p; Value=%p)', [Pointer(aHandle), Pointer(@aValue)]);{$ENDIF}
- 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;
- {$IFDEF DEBUG}utlLogger.log(nil, 'ltsCharGetGlyphMetric=%d', [Integer(result)]);{$ENDIF}
- end;
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- function ltsCharSetGlyphMetric(aHandle: TltsCharHandle; constref aValue: TtsGlyphMetric): TltsErrorCode; stdcall;
- var
- c: TtsChar;
- begin
- try
- {$IFDEF DEBUG}utlLogger.log(nil, 'ltsCharSetGlyphMetric(Handle=%p; Value=%p)', [Pointer(aHandle), Pointer(@aValue)]);{$ENDIF}
- 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;
- {$IFDEF DEBUG}utlLogger.log(nil, 'ltsCharSetGlyphMetric=%d', [Integer(result)]);{$ENDIF}
- end;
-
- end.
-
|