@@ -9,6 +9,7 @@ program hUGETracker; |
| 9 |
uses |
9 |
uses |
| 10 |
{$ifdef unix} |
10 |
{$ifdef unix} |
| 11 |
cthreads, |
11 |
cthreads, |
|
|
12 |
fontconfig, |
| 12 |
{$endif} |
13 |
{$endif} |
| 13 |
{$ifdef MSWINDOWS} |
14 |
{$ifdef MSWINDOWS} |
| 14 |
Windows, |
15 |
Windows, |
@@ -30,7 +31,7 @@ uses |
| 30 |
|
31 |
|
| 31 |
{$ifdef MSWINDOWS} |
32 |
{$ifdef MSWINDOWS} |
| 32 |
// https://forum.lazarus.freepascal.org/index.php?topic=39124.0 |
33 |
// https://forum.lazarus.freepascal.org/index.php?topic=39124.0 |
| 33 |
Function AddFont (Dir : PAnsiChar; |
34 |
function AddFont (Dir : PAnsiChar; |
| 34 |
Flag: DWORD): LongBool; StdCall; |
35 |
Flag: DWORD): LongBool; StdCall; |
| 35 |
External GDI32 |
36 |
External GDI32 |
| 36 |
Name 'AddFontResourceExA'; |
37 |
Name 'AddFontResourceExA'; |
@@ -58,14 +59,12 @@ begin |
| 58 |
{$endif} |
59 |
{$endif} |
| 59 |
|
60 |
|
| 60 |
{$ifdef UNIX} |
61 |
{$ifdef UNIX} |
| 61 |
// This is the correct way to load a font on Linux according to |
62 |
// This is the correct way to load a font on Linux according to... I dunno man, but this seems to work |
| 62 |
// #linux on freenode. |
63 |
if FcConfigAppFontAddFile(nil, PChar('PixeliteTTF.ttf')) = 0 then |
| 63 |
if not DirectoryExists(GetUserDir+'.fonts') then |
64 |
Writeln(StdErr, '[ERROR] Couldn''t load Pixelite!!!'); |
| 64 |
CreateDir(GetUserDir+'.fonts'); |
65 |
|
|
|
66 |
PangoFcFontMapConfigChanged(PangoCairoFontMapGetDefault); |
| 65 |
|
67 |
|
| 66 |
if not (CopyFile('./PixeliteTTF.ttf', GetUserDir+'.fonts/PixeliteTTF.ttf') |
|
|
| 67 |
and (ExecuteProcess('/bin/bash', '-c fc-cache') = 0)) |
|
|
| 68 |
then Writeln(StdErr, '[ERROR] Couldn''t copy Pixelite to ~/.fonts !!!'); |
|
|
| 69 |
{$endif} |
68 |
{$endif} |
| 70 |
|
69 |
|
| 71 |
{$ifdef PRODUCTION} |
70 |
{$ifdef PRODUCTION} |