| @@ -33,10 +33,10 @@ | |||||
| -K$00400000 | -K$00400000 | ||||
| -LE"c:\zusatzprogramme\delphi 7\Projects\Bpl" | -LE"c:\zusatzprogramme\delphi 7\Projects\Bpl" | ||||
| -LN"c:\zusatzprogramme\delphi 7\Projects\Bpl" | -LN"c:\zusatzprogramme\delphi 7\Projects\Bpl" | ||||
| -U"..\..;..\utils" | |||||
| -O"..\..;..\utils" | |||||
| -I"..\..;..\utils" | |||||
| -R"..\..;..\utils" | |||||
| -U"..\utils;..\.." | |||||
| -O"..\utils;..\.." | |||||
| -I"..\utils;..\.." | |||||
| -R"..\utils;..\.." | |||||
| -w-UNSAFE_TYPE | -w-UNSAFE_TYPE | ||||
| -w-UNSAFE_CODE | -w-UNSAFE_CODE | ||||
| -w-UNSAFE_CAST | -w-UNSAFE_CAST | ||||
| @@ -94,7 +94,7 @@ OutputDir= | |||||
| UnitOutputDir= | UnitOutputDir= | ||||
| PackageDLLOutputDir= | PackageDLLOutputDir= | ||||
| PackageDCPOutputDir= | PackageDCPOutputDir= | ||||
| SearchPath=..\..;..\utils | |||||
| SearchPath=..\utils;..\.. | |||||
| Packages=rtl;vcl;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;vclx;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;adortl;ibxpress;vclactnband;bdertl;vclshlctrls;dclOfficeXP | Packages=rtl;vcl;vclie;xmlrtl;inet;inetdbbde;inetdbxpress;vclx;dbrtl;soaprtl;dsnap;VclSmp;dbexpress;vcldb;dbxcds;adortl;ibxpress;vclactnband;bdertl;vclshlctrls;dclOfficeXP | ||||
| Conditionals= | Conditionals= | ||||
| DebugSourceDirs= | DebugSourceDirs= | ||||
| @@ -134,6 +134,5 @@ Comments= | |||||
| Count=1 | Count=1 | ||||
| Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; | Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; | ||||
| [HistoryLists\hlSearchPath] | [HistoryLists\hlSearchPath] | ||||
| Count=2 | |||||
| Item0=..\..;..\utils | |||||
| Item1=..\..;..\lib | |||||
| Count=1 | |||||
| Item0=..\utils;..\.. | |||||
| @@ -14877,8 +14877,6 @@ begin | |||||
| if LibHandle = nil then | if LibHandle = nil then | ||||
| LibHandle := GL_LibHandle; | LibHandle := GL_LibHandle; | ||||
| Result := nil; | |||||
| {$IFDEF DGL_WIN} | {$IFDEF DGL_WIN} | ||||
| Result := GetProcAddress({%H-}HMODULE(LibHandle), ProcName); | Result := GetProcAddress({%H-}HMODULE(LibHandle), ProcName); | ||||
| @@ -181,6 +181,7 @@ begin | |||||
| GL_DEBUG_TYPE_OTHER_ARB : typ:= 'OTHER'; | GL_DEBUG_TYPE_OTHER_ARB : typ:= 'OTHER'; | ||||
| end; | end; | ||||
| sv := svLow; | |||||
| case severity of | case severity of | ||||
| GL_DEBUG_SEVERITY_LOW_ARB: sv := svLow; | GL_DEBUG_SEVERITY_LOW_ARB: sv := svLow; | ||||
| GL_DEBUG_SEVERITY_MEDIUM_ARB: sv := svMedium; | GL_DEBUG_SEVERITY_MEDIUM_ARB: sv := svMedium; | ||||
| @@ -207,6 +208,7 @@ begin | |||||
| end; | end; | ||||
| src:= 'GL_' + src; | src:= 'GL_' + src; | ||||
| sv := svLow; | |||||
| case severity of | case severity of | ||||
| GL_DEBUG_SEVERITY_LOW_AMD: sv := svLow; | GL_DEBUG_SEVERITY_LOW_AMD: sv := svLow; | ||||
| GL_DEBUG_SEVERITY_MEDIUM_AMD: sv := svMedium; | GL_DEBUG_SEVERITY_MEDIUM_AMD: sv := svMedium; | ||||
| @@ -288,17 +290,15 @@ end; | |||||
| class function TglcContext.GetPlatformClass: TglcContextClass; | class function TglcContext.GetPlatformClass: TglcContextClass; | ||||
| begin | begin | ||||
| Result := nil; | |||||
| {$IFDEF WINDOWS} | |||||
| {$IF DEFINED(WINDOWS)} | |||||
| Result:= TglcContextWGL; | Result:= TglcContextWGL; | ||||
| {$ELSE}{$IFDEF WIN32} | |||||
| {$ELSEIF DEFINED(WIN32)} | |||||
| Result:= TglcContextWGL; | Result:= TglcContextWGL; | ||||
| {$ENDIF}{$ENDIF} | |||||
| {$IFDEF LINUX} | |||||
| {$ELSEIF DEFINED(LINUX)} | |||||
| Result:= TglcContextGtk2GLX; | Result:= TglcContextGtk2GLX; | ||||
| {$ENDIF} | |||||
| if not Assigned(result) then | |||||
| raise EGLError.Create('unable to find suitabe context class'); | |||||
| {$ELSE} | |||||
| raise EGLError.Create('unable to find suitabe context class'); | |||||
| {$IFEND} | |||||
| end; | end; | ||||
| class function TglcContext.IsAnyContextActive: boolean; | class function TglcContext.IsAnyContextActive: boolean; | ||||
| @@ -157,7 +157,7 @@ var | |||||
| else if multiEXTSup then | else if multiEXTSup then | ||||
| wglChoosePixelFormatEXT(tmpContext.FDC, @IAttrib[0], @FAttrib, MaxCount, pPFList, @Count); | wglChoosePixelFormatEXT(tmpContext.FDC, @IAttrib[0], @FAttrib, MaxCount, pPFList, @Count); | ||||
| if Count > length(PFList) then | |||||
| if Integer(Count) > length(PFList) then | |||||
| Count := length(PFList); | Count := length(PFList); | ||||
| QueryAtrib := WGL_SAMPLES_ARB; | QueryAtrib := WGL_SAMPLES_ARB; | ||||
| @@ -123,9 +123,9 @@ end; | |||||
| procedure TtsFontRegistrationFile.UnregisterFont; | procedure TtsFontRegistrationFile.UnregisterFont; | ||||
| begin | begin | ||||
| if Assigned(RemoveFontResourceExA) then | if Assigned(RemoveFontResourceExA) then | ||||
| RemoveFontResourceExA(PAnsiChar(fFilename), 0, nil) | |||||
| RemoveFontResourceExA(PAnsiChar(AnsiString(fFilename)), 0, nil) | |||||
| else if Assigned(RemoveFontResourceA) then | else if Assigned(RemoveFontResourceA) then | ||||
| RemoveFontResourceA(PAnsiChar(fFilename)); | |||||
| RemoveFontResourceA(PAnsiChar(AnsiString(fFilename))); | |||||
| end; | end; | ||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| @@ -143,9 +143,9 @@ begin | |||||
| // register font | // register font | ||||
| if Assigned(AddFontResourceExA) then | if Assigned(AddFontResourceExA) then | ||||
| fIsRegistered := (AddFontResourceExA(PAnsiChar(fFilename), 0, nil) > 0) | |||||
| fIsRegistered := (AddFontResourceExA(PAnsiChar(AnsiString(fFilename)), 0, nil) > 0) | |||||
| else if Assigned(AddFontResourceA) then | else if Assigned(AddFontResourceA) then | ||||
| fIsRegistered := (AddFontResourceA(PAnsiChar(fFilename)) > 0) | |||||
| fIsRegistered := (AddFontResourceA(PAnsiChar(AnsiString(fFilename))) > 0) | |||||
| else | else | ||||
| fIsRegistered := false; | fIsRegistered := false; | ||||
| end; | end; | ||||
| @@ -295,7 +295,7 @@ begin | |||||
| exit; | exit; | ||||
| w := Metric.gmBlackBoxX; | w := Metric.gmBlackBoxX; | ||||
| h := Metric.gmBlackBoxY; | h := Metric.gmBlackBoxY; | ||||
| srcW := (Size div h) * 8; | |||||
| srcW := (Integer(Size) div h) * 8; | |||||
| if (w <= 0) or (h <= 0) then | if (w <= 0) or (h <= 0) then | ||||
| exit; | exit; | ||||
| aImage.CreateEmpty(aFont.Renderer.Format, w, h); | aImage.CreateEmpty(aFont.Renderer.Format, w, h); | ||||
| @@ -316,7 +316,8 @@ end; | |||||
| procedure TtsFontGeneratorGDI.GetCharImageAANormal(const aDC: HDC; const aFont: TtsFontGDI; const aCharCode: WideChar; const aImage: TtsImage); | procedure TtsFontGeneratorGDI.GetCharImageAANormal(const aDC: HDC; const aFont: TtsFontGDI; const aCharCode: WideChar; const aImage: TtsImage); | ||||
| var | var | ||||
| Metric: TGlyphMetrics; | Metric: TGlyphMetrics; | ||||
| GlyphIndex, OutlineRes, tmp, Spacer, x, y, w, h: Integer; | |||||
| OutlineRes: DWORD; | |||||
| GlyphIndex, tmp, Spacer, x, y, w, h: Integer; | |||||
| Size: Cardinal; | Size: Cardinal; | ||||
| Buffer, pSrc, pDst: PByte; | Buffer, pSrc, pDst: PByte; | ||||
| @@ -390,7 +391,7 @@ var | |||||
| DC: HDC; | DC: HDC; | ||||
| TableName, BufSize: Cardinal; | TableName, BufSize: Cardinal; | ||||
| Buffer: PByte; | Buffer: PByte; | ||||
| Lang: AnsiString; | |||||
| Lang, tmpName: AnsiString; | |||||
| TextMetric: TTextMetricW; | TextMetric: TTextMetricW; | ||||
| OutlineMetric: TOutlineTextmetricW; | OutlineMetric: TOutlineTextmetricW; | ||||
| @@ -403,8 +404,6 @@ var | |||||
| end; | end; | ||||
| begin | begin | ||||
| result := 0; | |||||
| FillChar(aProperties, SizeOf(aProperties), #0); | FillChar(aProperties, SizeOf(aProperties), #0); | ||||
| aProperties.Size := aSize; | aProperties.Size := aSize; | ||||
| aProperties.Style := aStyle; | aProperties.Style := aStyle; | ||||
| @@ -413,8 +412,9 @@ begin | |||||
| // prepare font attribs | // prepare font attribs | ||||
| FillChar(LogFont, SizeOf(LogFont), #0); | FillChar(LogFont, SizeOf(LogFont), #0); | ||||
| tmpName := AnsiString(aFontname); | |||||
| for i := 1 to min(Length(aFontname), Length(LogFont.lfFaceName)) do | for i := 1 to min(Length(aFontname), Length(LogFont.lfFaceName)) do | ||||
| LogFont.lfFaceName[i-1] := aFontname[i]; | |||||
| LogFont.lfFaceName[i-1] := tmpName[i]; | |||||
| LogFont.lfCharSet := DEFAULT_CHARSET; | LogFont.lfCharSet := DEFAULT_CHARSET; | ||||
| LogFont.lfHeight := -aSize; | LogFont.lfHeight := -aSize; | ||||
| LogFont.lfWeight := _(tsStyleBold in aStyle, FW_BOLD, FW_NORMAL); | LogFont.lfWeight := _(tsStyleBold in aStyle, FW_BOLD, FW_NORMAL); | ||||
| @@ -242,7 +242,7 @@ procedure InitGDI; | |||||
| function GetProcAddr(const aLibHandle: TLibHandle; const aName: String): Pointer; | function GetProcAddr(const aLibHandle: TLibHandle; const aName: String): Pointer; | ||||
| begin | begin | ||||
| result := GetProcAddress(aLibHandle, PAnsiChar(aName)); | |||||
| result := GetProcAddress(aLibHandle, PAnsiChar(AnsiString(aName))); | |||||
| if not Assigned(result) then | if not Assigned(result) then | ||||
| raise EtsException.Create('unable to load procedure from library: ' + aName); | raise EtsException.Create('unable to load procedure from library: ' + aName); | ||||
| end; | end; | ||||
| @@ -279,6 +279,7 @@ var | |||||
| var | var | ||||
| w, h: Integer; | w, h: Integer; | ||||
| begin | begin | ||||
| result := false; | |||||
| w := X2 - X1; | w := X2 - X1; | ||||
| h := Y2 - Y1; | h := Y2 - Y1; | ||||
| if not Assigned(aItem) or | if not Assigned(aItem) or | ||||
| @@ -140,9 +140,9 @@ type | |||||
| fChars: array[Byte] of PtsFontCharArray; | fChars: array[Byte] of PtsFontCharArray; | ||||
| fCreateChars: Boolean; | fCreateChars: Boolean; | ||||
| function HasChar(const aCharCode: WideChar): Boolean; | |||||
| //function HasChar(const aCharCode: WideChar): Boolean; | |||||
| function GetChar(const aCharCode: WideChar): TtsChar; | function GetChar(const aCharCode: WideChar): TtsChar; | ||||
| function GetCharCreate(const aCharCode: WideChar): TtsChar; | |||||
| //function GetCharCreate(const aCharCode: WideChar): TtsChar; | |||||
| procedure AddChar(const aCharCode: WideChar; const aChar: TtsChar); overload; | procedure AddChar(const aCharCode: WideChar; const aChar: TtsChar); overload; | ||||
| protected | protected | ||||
| constructor Create(const aRenderer: TtsRenderer; const aGenerator: TtsFontGenerator; const aProperties: TtsFontProperties); | constructor Create(const aRenderer: TtsRenderer; const aGenerator: TtsFontGenerator; const aProperties: TtsFontProperties); | ||||
| @@ -911,9 +911,9 @@ var | |||||
| // read color and clear channels | // read color and clear channels | ||||
| v := 0; | v := 0; | ||||
| tsFormatUnmap(aSrc.Format, src, c); | tsFormatUnmap(aSrc.Format, src, c); | ||||
| for j := 0 to 3 do | |||||
| if (TtsColorChannel(j) in aChannelMask) then | |||||
| c.arr[j] := 0; | |||||
| for i := 0 to 3 do | |||||
| if (TtsColorChannel(i) in aChannelMask) then | |||||
| c.arr[i] := 0; | |||||
| // do blur | // do blur | ||||
| for i := 0 to aKernel.ItemCount-1 do with aKernel.Items[i] do begin | for i := 0 to aKernel.ItemCount-1 do with aKernel.Items[i] do begin | ||||
| @@ -927,9 +927,9 @@ var | |||||
| end; | end; | ||||
| // calc final color and write | // calc final color and write | ||||
| for j := 0 to 3 do | |||||
| for i := 0 to 3 do | |||||
| if (TtsColorChannel(i) in aChannelMask) then | if (TtsColorChannel(i) in aChannelMask) then | ||||
| c.arr[j] := c.arr[j] / v; | |||||
| c.arr[i] := c.arr[i] / v; | |||||
| tsFormatMap(aDst.Format, dst, c); | tsFormatMap(aDst.Format, dst, c); | ||||
| end; | end; | ||||
| end; | end; | ||||
| @@ -978,10 +978,12 @@ end; | |||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| //TtsFont/////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //TtsFont/////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| { | |||||
| function TtsFont.HasChar(const aCharCode: WideChar): Boolean; | function TtsFont.HasChar(const aCharCode: WideChar): Boolean; | ||||
| begin | begin | ||||
| result := Assigned(GetChar(aCharCode)); | result := Assigned(GetChar(aCharCode)); | ||||
| end; | end; | ||||
| } | |||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| function TtsFont.GetChar(const aCharCode: WideChar): TtsChar; | function TtsFont.GetChar(const aCharCode: WideChar): TtsChar; | ||||
| @@ -996,12 +998,14 @@ begin | |||||
| end; | end; | ||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| { | |||||
| function TtsFont.GetCharCreate(const aCharCode: WideChar): TtsChar; | function TtsFont.GetCharCreate(const aCharCode: WideChar): TtsChar; | ||||
| begin | begin | ||||
| result := GetChar(aCharCode); | result := GetChar(aCharCode); | ||||
| if not Assigned(result) then | if not Assigned(result) then | ||||
| result := AddChar(aCharCode); | result := AddChar(aCharCode); | ||||
| end; | end; | ||||
| } | |||||
| //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||||
| procedure TtsFont.AddChar(const aCharCode: WideChar; const aChar: TtsChar); | procedure TtsFont.AddChar(const aCharCode: WideChar; const aChar: TtsChar); | ||||
| @@ -1664,7 +1668,6 @@ var | |||||
| else | else | ||||
| Dispose(p); | Dispose(p); | ||||
| p := nil; | |||||
| end; | end; | ||||
| end; | end; | ||||
| @@ -16,10 +16,10 @@ const | |||||
| NAME_ID_FULL_NAME = 4; | NAME_ID_FULL_NAME = 4; | ||||
| function MakeTTTableName(const ch1, ch2, ch3, ch4: Char): Cardinal; | function MakeTTTableName(const ch1, ch2, ch3, ch4: Char): Cardinal; | ||||
| function GetTTString(pBuffer: Pointer; BufferSize: Integer; NameID, LanguageID: Cardinal; var Text: AnsiString): Boolean; | |||||
| function GetTTString(pBuffer: Pointer; BufferSize: Integer; NameID, LanguageID: Cardinal; var Text: String): Boolean; | |||||
| function GetTTFontFullNameFromStream(Stream: TStream; LanguageID: Cardinal): AnsiString; | |||||
| function GetTTFontFullNameFromFile(Filename: AnsiString; LanguageID: Cardinal): AnsiString; | |||||
| function GetTTFontFullNameFromStream(Stream: TStream; LanguageID: Cardinal): String; | |||||
| function GetTTFontFullNameFromFile(const aFilename: String; const aLanguageID: Cardinal): String; | |||||
| implementation | implementation | ||||
| @@ -141,7 +141,7 @@ begin | |||||
| Result := ord(ch4) shl 24 or ord(ch3) shl 16 or ord(ch2) shl 8 or ord(ch1); | Result := ord(ch4) shl 24 or ord(ch3) shl 16 or ord(ch2) shl 8 or ord(ch1); | ||||
| end; | end; | ||||
| function GetTTString(pBuffer: Pointer; BufferSize: Integer; NameID, LanguageID: Cardinal; var Text: AnsiString): Boolean; | |||||
| function GetTTString(pBuffer: Pointer; BufferSize: Integer; NameID, LanguageID: Cardinal; var Text: String): Boolean; | |||||
| var | var | ||||
| pActBuffer: pByte; | pActBuffer: pByte; | ||||
| ttNTHeader: TT_NAME_TABLE_HEADER; | ttNTHeader: TT_NAME_TABLE_HEADER; | ||||
| @@ -287,7 +287,7 @@ begin | |||||
| end; | end; | ||||
| end; | end; | ||||
| function GetTTFontFullNameFromStream(Stream: TStream; LanguageID: Cardinal): AnsiString; | |||||
| function GetTTFontFullNameFromStream(Stream: TStream; LanguageID: Cardinal): String; | |||||
| var | var | ||||
| TableName: Cardinal; | TableName: Cardinal; | ||||
| Buffer: Pointer; | Buffer: Pointer; | ||||
| @@ -309,13 +309,13 @@ begin | |||||
| end; | end; | ||||
| end; | end; | ||||
| function GetTTFontFullNameFromFile(Filename: AnsiString; LanguageID: Cardinal): AnsiString; | |||||
| function GetTTFontFullNameFromFile(const aFilename: String; const aLanguageID: Cardinal): String; | |||||
| var | var | ||||
| fs: TFileStream; | fs: TFileStream; | ||||
| begin | begin | ||||
| fs := TFileStream.Create(String(Filename), fmOpenRead or fmShareDenyWrite); | |||||
| fs := TFileStream.Create(aFilename, fmOpenRead or fmShareDenyWrite); | |||||
| try | try | ||||
| result := GetTTFontFullNameFromStream(fs, LanguageID); | |||||
| result := GetTTFontFullNameFromStream(fs, aLanguageID); | |||||
| finally | finally | ||||
| fs.Free; | fs.Free; | ||||
| end; | end; | ||||
| @@ -74,7 +74,6 @@ end; | |||||
| function tsAnsiToWide(aDst: PWideChar; const aSize: Integer; aSrc: PAnsiChar; | function tsAnsiToWide(aDst: PWideChar; const aSize: Integer; aSrc: PAnsiChar; | ||||
| const aCodePage: TtsCodePage; const aDefaultChar: WideChar): Integer; | const aCodePage: TtsCodePage; const aDefaultChar: WideChar): Integer; | ||||
| begin | begin | ||||
| result := 0; | |||||
| case aCodePage of | case aCodePage of | ||||
| tsUTF8: | tsUTF8: | ||||
| result := tsUTF8ToWide(aDst, aSize, aSrc, aDefaultChar); | result := tsUTF8ToWide(aDst, aSize, aSrc, aDefaultChar); | ||||