Извините, ничего не найдено.

Не расстраивайся! Лучше выпей чайку!
Регистрация
Справка
Календарь

Вернуться   forum.boolean.name > Программирование игр для мобильных телефонов > MidletPascal > Библиотеки

Ответ
 
Опции темы
Старый 18.12.2007, 16:27   #16
Kurdt
ПроЭктировщик
 
Регистрация: 28.03.2007
Сообщений: 194
Написано 7 полезных сообщений
(для 25 пользователей)
Re: Свои шрифты

Смотри с примером атач
(Offline)
 
Ответить с цитированием
Старый 21.12.2007, 08:41   #17
beloff
AnyKey`щик
 
Регистрация: 18.11.2007
Сообщений: 17
Написано 0 полезных сообщений
(для 0 пользователей)
Re: Свои шрифты

Каво посмотреть?
(Offline)
 
Ответить с цитированием
Старый 10.08.2008, 09:38   #18
odd
Мастер
 
Аватар для odd
 
Регистрация: 06.09.2007
Адрес: Донецк, ДНР
Сообщений: 1,023
Написано 298 полезных сообщений
(для 713 пользователей)
Ответ: Свои шрифты

Программу GenFont неплохо бы подправть. В программу добавить функцию сглаживания шрифтов (ClearType или обычный Antialiasing). При генерации DAT файла в качестве символа переноса строки использовать не 0x0D, 0x0A, а просто 0x0D.
(Offline)
 
Ответить с цитированием
Старый 10.08.2008, 17:35   #19
Romanzes
Разработчик
 
Аватар для Romanzes
 
Регистрация: 06.04.2008
Сообщений: 541
Написано 196 полезных сообщений
(для 637 пользователей)
Ответ: Свои шрифты

Еще после GenFont бывает буквы получаются с артефактами, например, какая-нибудь лишняя точка в букву влазиет и приходится самому править.
(Offline)
 
Ответить с цитированием
Старый 11.08.2008, 08:32   #20
odd
Мастер
 
Аватар для odd
 
Регистрация: 06.09.2007
Адрес: Донецк, ДНР
Сообщений: 1,023
Написано 298 полезных сообщений
(для 713 пользователей)
Ответ: Свои шрифты

Сообщение от Romanzes Посмотреть сообщение
Еще после GenFont бывает буквы получаются с артефактами, например, какая-нибудь лишняя точка в букву влазиет и приходится самому править.
Та да. Есть такое. Картинку приходится редактировать потом. Сжимать в PhotoShop. DAT файл я правлю в MIBeditor чтоб перенос строки был не 0x0D0D а 0x0D.
(Offline)
 
Ответить с цитированием
Старый 24.02.2009, 10:47   #21
@llien
Оператор ЭВМ
 
Аватар для @llien
 
Регистрация: 30.01.2009
Сообщений: 41
Написано одно полезное сообщение
(для 5 участников)
Стрелка Ответ: Свои шрифты

Луди у меня почти безгеморойный способ
файл конфига:
/fonts/dos_font_10.png
rus_dos
10
33
а код модуля вот:
unit fon;
interface
var fnt_im:image;
symbols_cnt,hw_font:Integer;
file_font,numer_file:resource;
font_type,numer_file_str:string;
numeration:array[0..1000]of string;
procedure load_font(fnt_ini:string);
procedure draw_char(num,x,y:integer);
function get_font_HW:INTEGER; 
function get_font_type:string;
procedure draw_text(text:string;x,y:integer);
function get_text_width(text:string):integer;
function get_text_height(text:string):integer;
function numeration_fnc(chr:char):integer;
implementation
 { тела функций }
procedure load_font(fnt_ini:string);
 begin
 file_font:=openResource('/'+fnt_ini);
  if (resourceAvailable(file_font)) then begin 
   fnt_im:=loadimage(readline(file_font));
   font_type:=readline(file_font);
   numer_file_str:=readline(file_font);
   hw_font:=stringtointeger(readline(file_font));
   symbols_cnt:=stringtointeger(readline(file_font));
  end;
 closeResource(file_font);
 end;
procedure draw_char(num,x,y:integer);
 begin
  drawimage(ImageFromImage(fnt_im,num*hw_font,0,hw_font,hw_font),x,y);
 end;
function get_font_HW:integer;
 begin
  get_font_HW:=hw_font;
 end;
function get_font_type:string;
 begin
  get_font_type:=font_type;
 end;
procedure unload_font;
 begin
  fnt_im:=loadimage('/icon.png');
  font_type:='';
  hw_font:=0;
  symbols_cnt:=0;
 end;
procedure draw_text(text:string;x,y:integer;);
 var i:integer;
 num:integer;
 begin
  text:=upcase(text);
  for i:=0 to length(text)-1 do begin
   if getchar(text,i)<>' ' then begin
    num:=numeration_fnc(getchar(text,i));
    draw_char(num,x+i*hw_font,y);
   end;
  end;
 end;
function get_text_width(text:string):integer;
 begin
  get_text_width:=length(text)*hw_font;
 end;
function get_text_Height(text:string):integer;
 begin
  get_text_height:=hw_font;
 end;
function numeration_fnc(chr:char):integer;
 begin
  if chr='А' then numeration_fnc:=0;
  if chr='Б' then numeration_fnc:=1;
  if chr='В' then numeration_fnc:=2;
  if chr='Г' then numeration_fnc:=3;
  if chr='Д' then numeration_fnc:=4;
  if chr='Е' then numeration_fnc:=5;
  if chr='Ё' then numeration_fnc:=6;
  if chr='Ж' then numeration_fnc:=7;
  if chr='З' then numeration_fnc:=8;
  if chr='И' then numeration_fnc:=9;
  if chr='Й' then numeration_fnc:=10;
  if chr='К' then numeration_fnc:=11;
  if chr='Л' then numeration_fnc:=12;
  if chr='М' then numeration_fnc:=13;
  if chr='Н' then numeration_fnc:=14;
  if chr='О' then numeration_fnc:=15;
  if chr='П' then numeration_fnc:=16;
  if chr='Р' then numeration_fnc:=17;
  if chr='С' then numeration_fnc:=18;
  if chr='Т' then numeration_fnc:=19;
  if chr='У' then numeration_fnc:=20;
  if chr='Ф' then numeration_fnc:=21;
  if chr='Х' then numeration_fnc:=22;
  if chr='Ц' then numeration_fnc:=23;
  if chr='Ч' then numeration_fnc:=24;
  if chr='Ш' then numeration_fnc:=25;
  if chr='Щ' then numeration_fnc:=26;
  if chr='Ъ' then numeration_fnc:=27;
  if chr='Ы' then numeration_fnc:=28;
  if chr='Ь' then numeration_fnc:=29;
  if chr='Э' then numeration_fnc:=30;
  if chr='Ю' then numeration_fnc:=31;
  if chr='Я' then numeration_fnc:=32;
  if chr='!' then numeration_fnc:=33;
  if chr='@' then numeration_fnc:=34;
  if chr='#' then numeration_fnc:=35;
  if chr='$' then numeration_fnc:=36;
  if chr='%' then numeration_fnc:=37;
  if chr='?' then numeration_fnc:=38;
  if chr='.' then numeration_fnc:=39;
  if chr=',' then numeration_fnc:=40;
  if chr='*' then numeration_fnc:=41;
  if chr='=' then numeration_fnc:=42;
  if chr='-' then numeration_fnc:=43;
  if chr=''''' then numeration_fnc:=44;
  if chr=':' then numeration_fnc:=45;
  if chr='A' then numeration_fnc:=42+4;
  if chr='B' then numeration_fnc:=43+4;
  if chr='C' then numeration_fnc:=44+4;
  if chr='D' then numeration_fnc:=45+4;
  if chr='E' then numeration_fnc:=46+4;
  if chr='F' then numeration_fnc:=47+4;
  if chr='G' then numeration_fnc:=48+4;
  if chr='H' then numeration_fnc:=49+4;
  if chr='I' then numeration_fnc:=50+4;
  if chr='J' then numeration_fnc:=51+4;
  if chr='K' then numeration_fnc:=52+4;
  if chr='L' then numeration_fnc:=53+4;
  if chr='M' then numeration_fnc:=54+4;
  if chr='N' then numeration_fnc:=55+4;
  if chr='O' then numeration_fnc:=56+4;
  if chr='P' then numeration_fnc:=57+4;
  if chr='Q' then numeration_fnc:=58+4;
  if chr='R' then numeration_fnc:=59+4;
  if chr='S' then numeration_fnc:=60+4;
  if chr='T' then numeration_fnc:=61+4;
  if chr='U' then numeration_fnc:=62+4;
  if chr='V' then numeration_fnc:=63+4;
  if chr='W' then numeration_fnc:=64+4;
  if chr='X' then numeration_fnc:=65+4;
  if chr='Y' then numeration_fnc:=66+4;
  if chr='Z' then numeration_fnc:=67+4;
  if chr='0' then numeration_fnc:=68+4;
  if chr='1' then numeration_fnc:=69+4;
  if chr='2' then numeration_fnc:=70+4;
  if chr='3' then numeration_fnc:=71+4;
  if chr='4' then numeration_fnc:=72+4;
  if chr='5' then numeration_fnc:=73+4;
  if chr='6' then numeration_fnc:=74+4;
  if chr='7' then numeration_fnc:=75+4;
  if chr='8' then numeration_fnc:=76+4;
  if chr='9' then numeration_fnc:=77+4;
 end;
initialization
 { инициализация }
end.
но есть малое условие:
1)симфолы шрифта не должны вылазить за грани описаные в строке номер 3
2)прозрачность ставим через MP а в grc Редакторе цвет фона делаем <> цвету символоф шрефта!
__________________
MPCoder
V_V

Последний раз редактировалось @llien, 24.02.2009 в 10:50. Причина: учёпетко
(Offline)
 
Ответить с цитированием
Ответ


Опции темы

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы не можете редактировать сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.

Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Шрифты для программистов Coks Болтовня 6 26.11.2009 01:04
Шрифты из Getfont GRAY_WOLF MidletPascal 2 25.09.2009 23:17
Шрифты oooooo MidletPascal 1 11.05.2009 18:18
Шрифты MaDoW Программирование 3 26.12.2007 22:33
Шрифты zheland 2D-программирование 1 27.10.2007 22:20


Часовой пояс GMT +4, время: 18:15.


vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot
Style crйe par Allan - vBulletin-Ressources.com