Current time: 22.11.2024, 13:32 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
Плагины. Обсуждение
» Plugins. Discussion & Questions
Author Message
igrik Offline

Posts: 2819
Post: #106

You need to customize Chinese characters in file bigfont2.fnt
This window only uses the bigfont2.fnt


game bug fixes extended.dll || My Plugins || My GitHub
15.09.2020 12:44
Visit this user's website Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #107

igrik, it can't be done as bigfont2.fnt does not include Chinese characters (neither smalfont, medfont and bigfont.fnt from the Chinese pack).

Chinese characters use a different mechanism to display in the game. It uses both .fnt and also hzk files (character library, can be found from here in dir WoG CN\Release\EraPlugins ).

Replacing hzk24 (character library meant to be used when bigfont.fnt is loaded) with hzk12 (use when medfont is loaded) also does not work. It does not makes the characters smaller, instead it just make all characters display incorrectly.


I'm not familiar with the Chinese plugin, unfortunately. The author of it has gone for long and not possible to tweak it again.
If the font definition only exists in bigfont2.fnt and Chinese plugin, then it seems nothing can be done now, sadly...Rolleyes


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 15.09.2020 15:04 by Archer30.)
15.09.2020 13:40
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #108

Archer30, Rose Kavalier already wrote the reason, afair. Chinese plugin detects font by looking at first 3 characters of its name. So for "big" it loads hzk24.
Possible sizes: 28x25, 14x16, 11x11. It seems like big font should also be 24px height in English.Something is wrong?

igrik, what's is bigfont2.fnt width/height?


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
15.09.2020 15:32
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #109

Berserker, I was not aware of this conclusion. I don't quite get it though.
For example, I have smaller fonts including medfont.fnt and hzk12, by replacing bigfont.fnt, bigfont2.fnt and hzk24, all big should look like med right?
That's what I tried, but it didn't work. Fonts in home page of wog menu is always the same size.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 15.09.2020 16:16 by Archer30.)
15.09.2020 16:14
Find all posts by this user Quote this message in a reply
igrik Offline

Posts: 2819
Post: #110

(15.09.2020 15:32)Berserker Wrote:  igrik, what's is bigfont2.fnt width/height?
Мои шрифты, которые имеют суффикс "2".
Высота шрифта bigfont2.fnt - 24 px

Archer30-у нужно просто отредактировать шрифты, потому что в сейчас высота его шрифта bigfont.fnt в английской раскладке (который он скидывает по ссылке на китайскую локализацию) составляет 32 px.

Я попробовал заменить bigfont2.fnt, подменив его на medfont.fnt, и у меня сработало. Почему не сработало у него - потому что он видимо что-то не правильно сделал.


game bug fixes extended.dll || My Plugins || My GitHub
15.09.2020 16:46
Visit this user's website Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #111

igrik, китайские шрифты грузятся из папки с плагином WoG Chinese. Они имеют свой формат. Там три шрифта: 28x25, 14x16, 11x11.
Автор плагина так определяет, каким шрифтом рисовать символ: обратимся r текущему Герои 3 шрифту, поле name.
Если big*, то используем шрифт 28х25, если med*, то используем шрифт 14х16, иначе 11х11.

Вот эта топорная привязка к именам и срабатывает. Но автор решил, что для шрифта 24х подойдёт китайский 28х25, который выглядит громоздко. Я ничего не упустил?

Code:
Font24Width:integer=28;
Font24Height:integer=25;
Font12Width:integer=14;
Font12Height:integer=16;
FontTinyWidth:integer=11;
FontTinyHeight:integer=11;

procedure SetFont(hfont:integer;var Width,Height:integer);stdcall;
begin
  if pInteger(hfont+4)^=1718053218 then
  begin
    Width:=Font24Width;
    Height:=Font24Height;
  end else
  if pInteger(hfont+4)^=2037279092 then
  begin
    Width:=FontTinyWidth;
    Height:=FontTinyHeight;
  end else
  begin
    Width:=Font12Width;
    Height:=Font12Height;
  end;
end;

Плагин я могу пересобрать, но альтернативного китайского шрифта кроме этого на 28х25 может не найтись.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
15.09.2020 17:07
Find all posts by this user Quote this message in a reply
igrik Offline

Posts: 2819
Post: #112

За объяснение проблемы - спасибо, я этого не знал.

Возникает вопрос: чем именно в данном случае я могу помочь?


game bug fixes extended.dll || My Plugins || My GitHub
15.09.2020 17:55
Visit this user's website Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #113

Ну это же просто! Сделай нам другие файлы китайских шрифтов!
Желательно 16x12, 18x14, 20x16 и т.д. На всякий случай всех размеров. 96-copy

Archer30, please translate wogcnconfig.ini contents.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
15.09.2020 18:22
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #114

Thank you igrik and Berserker, now I understand how the Chinese plugin work much more clearly.

Berserker, I somewhat know that why the author choose 28x25 and 14x16. it's becoz they are the original fonts extracted from the official Chinese Heroes 3 (While 11x11 seems to be original).

Translation of wogcnconfig.ini

Note that there are two versions of wogcn existing (I have no idea which the source code belongs to). The old release uses config mainly for switching between GB and GBK font, while the new one does not read from config, it just loads hz** files (GB), which is what we are using. For now we have no idea why the new one remove ini support, the history was erased completely. Rolleyes
dlls for these two versions can be found from here.

So my request is to shrink the font size of home page, ideally to make it look like the font without WoG Native Dialogs.
How about this, an extra plugin to appoint the Chinese font in the red square to blue?
This should be the easiest way for everyone.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 16.09.2020 08:15 by Archer30.)
15.09.2020 19:31
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #115

Archer30, then you'll lose 28x25 font support at all, only 14x16 will be used in all dialogs. Is it ok? You never need huge font?


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
15.09.2020 19:44
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #116

Rolleyes This is not ok. It can't be separated?
Strange, I don't get it. Why the home page of wog menu has to use 28x25 otherwise lose 28x25 in other dialogs?


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 15.09.2020 21:22 by Archer30.)
15.09.2020 19:55
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #117

Archer30, because wog home page will always load big font. It should not be language or plugin specific.
English "W" letter is 33 px at my pc in the same dialog.


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
15.09.2020 22:19
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #118

Thanks Berserker, but that does not explain that with wog native dialog disabled, the font looks just fit. Or is it a completely different mechanism in this case?


Latest ERA mods and scripts in development - My GitHub
15.09.2020 22:42
Find all posts by this user Quote this message in a reply
Berserker Offline
Administrators

Posts: 16657
Post: #119

Archer30, and what's with wog native dialogs, but without HD mod?


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
15.09.2020 23:23
Find all posts by this user Quote this message in a reply
Archer30 Offline
Moderators

Posts: 1175
Post: #120

Berserker, let me show you below.

By comparing with all my previous screenshots which are taken with HD, we have the
Conclusion: HD does not affect the font size of Chinese characters in wog menu home page.


Latest ERA mods and scripts in development - My GitHub
(This post was last modified: 16.09.2020 08:06 by Archer30.)
16.09.2020 06:56
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group