mkpdffontdef.pp 975 B

123456789101112131415161718192021222324252627282930313233343536
  1. {
  2. This file is part of the Free Component Library (FCL)
  3. Copyright (c) 2014 by Michael Van Canneyt
  4. This small program reads a TTF font file and creates a definition in a .ini file for later use
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$mode objfpc}
  12. {$h+}
  13. program mkpdffontdef;
  14. uses sysutils, fpttfencodings, fpparsettf;
  15. begin
  16. if (ParamCount<3) then
  17. begin
  18. writeln('Usage : ',ExtractFileName(paramstr(0)),' ttffilename encoding fntfilename');
  19. Halt(1);
  20. end;
  21. With TTFFileInfo.Create do
  22. try
  23. LoadFromFile(ParamStr(1));
  24. MakePDFFontDef(Paramstr(3),Paramstr(2),False)
  25. finally
  26. Free;
  27. end;
  28. end.