libretro / retroarch-assets

Assets needed for RetroArch - e.g. menu drivers, etc. Also contains the official branding.
Creative Commons Attribution 4.0 International
170 stars 160 forks source link

update RGUI bitmap font #400

Closed trngaje closed 3 years ago

trngaje commented 3 years ago

I modified the Korean alphabet to make it look clearer. The English text was revised to a wider width of 2 pixels. rgui한글폰트수정

trngaje commented 3 years ago

@jdgleaver The font was manually modified by using the pixel font editor. I modified about 2,000 Korean characters. and The width of English characters is increased to match the Korean letters.

jdgleaver commented 3 years ago

@trngaje Oh wow! These new fonts look fantastic. This must have taken many hours. Thank you for this excellent work!

@twinaphex This is a huge improvement - please merge :)

trngaje commented 3 years ago

@jdgleaver i made russian 10x10 bitmap font.

bitmap10x10_rus.zip the range of letters : 0x400~0x45f However, "Видео "sentences are always displayed on the right side of the retroarch menu. I think I need to modify some of the retroarch codes, but I don't know where to correct them. 20210112_212917

jdgleaver commented 3 years ago

@trngaje This is incredible! Your Russian font is superb!

Yes, that Видео text is wrong. I looked at the code, and it seems that intl/msg_hash_ru.c is unfinished. With the following changes, it works correctly:

diff --git a/intl/msg_hash_ru.c b/intl/msg_hash_ru.c
index 8ceb3cf9c1..9ba66acba5 100644
--- a/intl/msg_hash_ru.c
+++ b/intl/msg_hash_ru.c
@@ -12,10 +12,15 @@
  *  You should have received a copy of the GNU General Public License along with RetroArch.
  *  If not, see <http://www.gnu.org/licenses/>.
  */
+#include <stdio.h>
 #include <stdint.h>
-#include <string.h>
+#include <stddef.h>
+
+#include <compat/strl.h>
+#include <string/stdstring.h>

 #include "../msg_hash.h"
+#include "../verbosity.h"

 #if defined(_MSC_VER) && !defined(_XBOX) && (_MSC_VER >= 1500 && _MSC_VER < 1900)
 #if (_MSC_VER >= 1700)
@@ -40,12 +45,51 @@ int msg_hash_get_help_ru_enum(enum msg_hash_enums msg, char *s, size_t len)
    return ret;
 }

+#ifdef HAVE_MENU
+static const char *menu_hash_to_str_ru_label_enum(enum msg_hash_enums msg)
+{
+   if (msg <= MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_END &&
+         msg >= MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN)
+   {
+      static char hotkey_lbl[128] = {0};
+      unsigned idx = msg - MENU_ENUM_LABEL_INPUT_HOTKEY_BIND_BEGIN;
+      snprintf(hotkey_lbl, sizeof(hotkey_lbl), "input_hotkey_binds_%d", idx);
+      return hotkey_lbl;
+   }
+
+   switch (msg)
+   {
+#include "msg_hash_lbl.h"
+      default:
+#if 0
+         RARCH_LOG("Unimplemented: [%d]\n", msg);
+#endif
+         break;
+   }
+
+   return "null";
+}
+#endif
+
 const char *msg_hash_to_str_ru(enum msg_hash_enums msg)
 {
+#ifdef HAVE_MENU
+   const char *ret = menu_hash_to_str_ru_label_enum(msg);
+
+   if (ret && !string_is_equal(ret, "null"))
+      return ret;
+#endif
+
    switch (msg)
    {
 #include "msg_hash_ru.h"
       default:
+#if 0
+         RARCH_LOG("Unimplemented: [%d]\n", msg);
+         {
+            RARCH_LOG("[%d] : %s\n", msg - 1, msg_hash_to_str(((enum msg_hash_enums)(msg - 1))));
+         }
+#endif
          break;
    }

Screenshot_2021-01-12_18-00-23

trngaje commented 3 years ago

@jdgleaver I checked that the code you sent works well. Please apply it directly to RetroArch when you have time.

I don't like some of the Cyrillic fonts which I created, so I'm going to googling and correct them appropriately. Some of the Cyrillic letters are used in Russian, some in Ukrainian, and I'm only familiar with some Russian, so it's not easy to modify all of them.

jdgleaver commented 3 years ago

Yes, certainly - I should be able to PR the code changes later today.

I don't like some of the Cyrillic fonts which I created, so I'm going to googling and correct them appropriately.

Thank you for your dedication - I look forward to any improvements :)

If you think it might take a while to update the font, would you be willing to add your current version to this PR? Just so we can have something in place for when the code gets merged? You could then submit your final version of the font in a follow-up PR.

trngaje commented 3 years ago

@jdgleaver

If you think it might take a while to update the font, would you be willing to add your current version to this PR?

Currently, there is no problem with Russian, so I added a file to current PR. It was only identified that the letter was being used in other countries. If I need another modification, I'll create a new PR.

jdgleaver commented 3 years ago

Ah, I understand!

Okay - thank you very much for adding the file.

jdgleaver commented 3 years ago

@trngaje The RetroArch changes have been merged: https://github.com/libretro/RetroArch/pull/11870

Thank you again for your continued work on this!

quiple commented 2 years ago

104170172-0dbe0b80-5444-11eb-8cda-744c6e2062e80

I'm the one who made the Korean font "Galmuri" used here. However, the Korean font applied to the RetroArch RGUI looks distorted as if "Galmuri11" font was forcibly reduced in size. Galmuri also supports 9x9 size (excluding margins), so it will look good if you apply it...

trngaje commented 2 years ago

한국분이 시군요.. 멋진 폰트 제작해 주셔서 감사합니다. 호기심으로 적용해 봤는데, 이렇게 폰트제작 하신 분에게 연락이 와서 감동이네요.. 최대한 폰트 원저작 표기는 해놓았습니다만.. 처음 8x8 폰트를 적용했었고.. CJK 폰트를 모두 적용하기에는 부족함이 느껴져서 10x10 으로 올렸습니다 물론 갈무리 폰트의 9x9, 11x11 이겠네요.. 폰트 초보자의 느낌으로 깨진 픽셀은 수정을 했지만.. retroarch rgui 구조상 영어와 한글 글자 폭을 다르게 가져갈 수 없어서.. 적절한 수준으로 영어 폭을 옆으로 늘렸습니다..

아래는 초기 8x8 사이즈로 구현했던 화면 입니다. rgui 메뉴에 한글 표시를 하기 위한 첫 도전이었으며 아직도 만족하지 못하는 상태입니다. 폰트 제작자의 의견을 받아 들여 개선을 해보도록 노력하겠습니다. truetype 폰트를 그대로 사용할 수 없는 구조라 bitmap 으로 변경하는 과정에서 초보적인 오류가 발생합니다. 가변 폭 폰트를 사용할 수 있게 한다면 좀더 자유롭게 9x9, 11x11 폰트를 있는 그대로 적용을 할 수 있을 듯 합니다.

다시한번 관심을 갖어 주어 감사드립니다. 저에겐 힘이되니까요.

You're Korean. Thank you for making a great font. I applied it out of curiosity, but I'm touched to hear from the font maker. I tried to mark the original font as much as possible. I applied 8x8 font for the first time. I thought it wasn't enough to apply all CJK fonts, so I raised it to 10x10. Of course, It's probably 9x9, 11x11 of your galmuri fonts. I fixed the broken pixels like a beginner in font... Due to the retroarchrgui structure, the width of English and Korean characters cannot be taken differently. I extended the width of the English to the same size of korean font.

Below is the screen implemented in the initial 8x8 size.

-----Original Message----- From: "Lee @.> To: @.>; Cc: @.>; @.>; Sent: 2021-12-25 (토) 03:07:36 (GMT+09:00) Subject: Re: [libretro/retroarch-assets] update RGUI bitmap font (#400)

I'm the one who made the Korean font "Galmuri" used here. However, the Korean font applied to the RetroArch RGUI looks distorted as if "Galmuri11" font was forcibly reduced in size. Galmuri also supports 9x9 size (excluding margins), so it will look good if you apply it... — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

quiple commented 2 years ago

@trngaje 그러셨군요 ㄷㄷ 갈무리의 리포지토리를 확인하시면 트루타입이 아닌 BDF 폰트도 올려져 있는데 이것도 필요하시면 참고하실 수 있을 것 같습니다. 여담이지만 갈무리9,11의 숫자는 여백을 제외한 크기의 픽셀 수를 뜻하는 거라서 보통 갈무리9는 10, 갈무리11은 12픽셀이라고 이해하시면 됩니다.

If you check the repository, BDF fonts are uploaded, so you can refer to it if necessary. And since the numbers Galmuri9 and 11 refer to the number of pixels of the size excluding the margin, you can usually take Galmuri9 as 10 and Galmuri11 as 12 pixels size.

IlDucci commented 2 years ago

Greetings, @trngaje . @DisasterMo in the main RA repo is getting ready to add Ukrainian to the localizations available for RetroArch (here: https://github.com/libretro/RetroArch/pull/13490 ), and we were wondering if the Russian Cyrillic table is both complete and includes the two extra characteres required for Ukrainian. Can you confirm us this data?

Also, some of the other existing languages would be in need of a Latin-2 extended set as well. Would you be available for these sort of edits?