Vanilla 1455 Posted June 20, 2019 Share Posted June 20, 2019 Hello everyone, A lot of people might already know the issue. If you choose Arial as Font for Metin2, texts will be displayed in a weird way and with dots. There are a few reasons for this to happen and increasing font size fixes it, but no one wants huge texts everywhere and obviously, we wannt a nice font. Not a trial and error. So here's a partial fix for it. If you choose very small font sizes (e. g. font size 9px) in locale_game.txt it'll still look a bit off but it's definitely readable. With these changes, you'll have no problem with font sizes 14px and higher. Maybe someone wants to share different approaches or ideas. I think with these changes the problem is almost entirely fixed, no one needs size 9 especially with Arial.. First open your Binary source and search for "LOGFONT" (without "" of course). You'll find two matches where it's being used for initialization of new fonts: One in TextBar.cpp(CTextBar::__SetFont) and one in GrpFontTexture(CGraphicFontTexture::GetFont). And these are the two functions where we need to make some changes first. Under the line where LOGFONT is used, you're gonna add the following code: HDC hDC = m_dib.GetDCHandle(); if (hDC) { auto px = fontSize * 72 / 96; fontSize = -MulDiv(px, GetDeviceCaps(hDC, LOGPIXELSY), 72); } This code segment does two things: First it converst px -> pt, since LOGFONT expects pt. And on second, it calculates the correct displaying size according to the ppi and the cell height. This leads to the variable we need: The point size. Note that there's a minus, which means that we'll automatically choose the nearest possible size according to the specified font size. So everything's good here. Als note that you need add this segment to BOTH places where LOGFONT is being used for initialization. You have to change the name fontSize according to the files you edit. In TextBar.cpp the example above fits, for GrpFontTexture you just need to change fontSize to m_fontSize. Now change the following parts in both functions: logFont.lfOutPrecision = OUT_TT_ONLY_PRECIS; logFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; logFont.lfQuality = NONANTIALIASED_QUALITY; logFont.lfPitchAndFamily = VARIABLE_PITCH; Note: You can also change logFont.lfWeight from FONT_NORMAL to FONT_MEDIUM or any other font weight if you wanna add up a mit more strength to your fonts. I just left it to FONT_NORMAL, which is fine. Also note that I chose NONANTIALIASED_QUALITY since anti-aliasing didn't make any change (not sure if Arial is even compatible, at least not those small font sized that I tested it with..). You can also change them to something like ClearType to do the job, that's up to you. I wanted to display the fonts just like they are, no mangling with them. But depending on your needs you can tweak a bit here. that's almost it! Last but not least, we have to change the way our adapter hDC does it's job. Especially since the above calculation for point size is only 100% true for MapMode MM_TEXT. And that's what we're gonna establish now. If you are in CGraphicFontTexture::GetFont, you can just scroll a bit higher. You'll see the initialization of hdC (function CGraphicFontTexture::Create). just below SetBkColor(hDC, 0); you can add these two lines: SetGraphicsMode(hDC, GM_ADVANCED); SetMapMode(hDC, MM_TEXT); Aaand you're done! That's it! Compile and enjoy! Best Regards Vanilla 25 We are the tortured. We're not your friends. As long as we're not visible. We are unfixable. Link to comment Share on other sites More sharing options...
Syriza 234 Posted June 20, 2019 Share Posted June 20, 2019 Thank you vanillaaaaaa Link to comment Share on other sites More sharing options...
ElRenardo 25 Posted June 21, 2019 Share Posted June 21, 2019 Hi, thanks for your effort ! Maybe I'm mistaking but it seems to only grow the font a bit. And when you try to decrease the font size to go back to normal, all the dots will appear again. What font and size do you use ? Here are my: Before: After: Before: (and - maybe) After: Can someone correct me and show his result ? Link to comment Share on other sites More sharing options...
Nirray 192 Posted June 21, 2019 Share Posted June 21, 2019 (edited) 6 minutes ago, ElRenardo said: Hi, thanks for your effort ! Maybe I'm mistaking but it seems to only grow the font a bit. And when you try to decrease the font size to go back to normal, all the dots will appear again. What font and size do you use ? Here are my: Before: After: Before: (and - maybe) After: Can someone correct me and show his result ? It's because the problem lays also in "bool CGraphicFontTexture::UpdateTexture()" and "CGraphicFontTexture::GetCharacterInfomation" I'm trying to fix it too, but all I was able to do was break font even further than it was before (Verdana: 12 [is fixed at 14] with my pFontTexture draw loop edits) Also changed the way the client draw chars to use user windows formating: No dots + cleartype but weird font-color-background - still working on this Anyway, thanks @Vanilla for LOGFONT px->pt solution, it helped me a little Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 1 I completely abandoned working on the files for this game. I do not respond to private messages. Link to comment Share on other sites More sharing options...
Active Member ReFresh 2339 Posted June 21, 2019 Active Member Share Posted June 21, 2019 @Vanilla I changed only logFont. things and I got the same result, as you got with more changes that you wrote. Arial is almost the same font as Script and I saw something like this: FF_SCRIPT. I think it have something to do with the Script font, but idk how should I use it. But practically I have the problems with letters like o, v which still contain the dot and it looks so ugly I'm still searching solution for this dot problem for these two letters. Only ClearType fixed the problem with dots, but this ClearType is used for Asian fonts and in game it looks so ugly. 1 I'll be always helpful! Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted June 21, 2019 Premium Share Posted June 21, 2019 Shogun fixed it. But i think it's hard to fix and nobody want's to say how. 1 Link to comment Share on other sites More sharing options...
Sumnix 9 Posted June 22, 2019 Share Posted June 22, 2019 (edited) The dot problem still continues. UI_DEF_FONT Arial: 14 UI_DEF_FONT_LARG Arial: 16 UI_DEF_FONT_SMALL Arial: 12 Edited August 26, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Vanilla 1455 Posted June 22, 2019 Author Share Posted June 22, 2019 @Sumnix did you try and change font_small to 14? Does it work then? Please send me those 3 functions you edited via pm so I can see how they look on your build. Maybe I missed to mention something I've done on my source since the characters are being displayed correctly there.. We are the tortured. We're not your friends. As long as we're not visible. We are unfixable. Link to comment Share on other sites More sharing options...
Sumnix 9 Posted June 23, 2019 Share Posted June 23, 2019 10 hours ago, Vanilla said: @Sumnix did you try and change font_small to 14? Does it work then? Please send me those 3 functions you edited via pm so I can see how they look on your build. Maybe I missed to mention something I've done on my source since the characters are being displayed correctly there.. original files, can you make the necessary arrangements? TextBar.cpp GrpFontTexture.cpp 2 1 1 1 Link to comment Share on other sites More sharing options...
_Sielu 13 Posted June 23, 2019 Share Posted June 23, 2019 (edited) rly guys?XD dev just use brain its easy to fix.. for example look for keys map (without fix) (with my fix) rly easy.. Edited August 21, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Vanilla 1455 Posted June 23, 2019 Author Share Posted June 23, 2019 (edited) vor 4 Minuten schrieb _Sielu: rly guys?XD dev just use brain its easy to fix.. for example look for keys map (without fix) (with my fix) rly easy.. If it's so easy, why don't you mind sharing it with the community instead of telling everyone how good you are? As I said, on my client it's fixed, but I don't remember every change I've made on it, so that's why I asked for the functions and will review them now. If you have a fix and wanna share it, post it, if not, please do not spam this topic with showing yourself off. Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 2 1 1 4 We are the tortured. We're not your friends. As long as we're not visible. We are unfixable. Link to comment Share on other sites More sharing options...
_Sielu 13 Posted June 23, 2019 Share Posted June 23, 2019 Some people bought it from me so it's not fair. (you have a hint, so be happy) regards Link to comment Share on other sites More sharing options...
Kori 170 Posted June 23, 2019 Share Posted June 23, 2019 1 hour ago, _Sielu said: Some people bought it from me so it's not fair. (you have a hint, so be happy) regards You sell this? You post here "I have a fix, but I don't share" you need new costumers? Or what ist the Pont to post here without helping 1 Link to comment Share on other sites More sharing options...
Vanilla 1455 Posted June 23, 2019 Author Share Posted June 23, 2019 Gerade eben schrieb Kori: You sell this? You post here "I have a fix, but I don't share" you need new costumers? Or what ist the Pont to post here without helping I don't see any reason for his posting either. So let's just keep him talk. Would be sad if anyone buys it and we have a fix that's about to be published. If anyone still buys his "easy fix" for money, then this person might not be the smartest one out there considering the fact that we're gonna fix this. As I said, on my client it works perfectly fine without any dots. So I only have to find the stuff I did on it and didn't mention.. Then we're good to go. 3 We are the tortured. We're not your friends. As long as we're not visible. We are unfixable. Link to comment Share on other sites More sharing options...
Premium Speachless 759 Posted June 23, 2019 Premium Share Posted June 23, 2019 Acum 3 ore, Vanilla a spus: I don't see any reason for his posting either. So let's just keep him talk. Would be sad if anyone buys it and we have a fix that's about to be published. If anyone still buys his "easy fix" for money, then this person might not be the smartest one out there considering the fact that we're gonna fix this. As I said, on my client it works perfectly fine without any dots. So I only have to find the stuff I did on it and didn't mention.. Then we're good to go. Works pretty normal on english, but try on other langs. Link to comment Share on other sites More sharing options...
Sumnix 9 Posted June 23, 2019 Share Posted June 23, 2019 20 hours ago, Vanilla said: @Sumnix did you try and change font_small to 14? Does it work then? Please send me those 3 functions you edited via pm so I can see how they look on your build. Maybe I missed to mention something I've done on my source since the characters are being displayed correctly there.. TextBar.cpp GrpFontTexture.cpp help? 1 Link to comment Share on other sites More sharing options...
Tunga 10 Posted June 26, 2019 Share Posted June 26, 2019 (edited) Works perfect. Thanks @Vanilla Edited August 21, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium TAUMP 838 Posted June 29, 2019 Premium Share Posted June 29, 2019 (edited) On 6/23/2019 at 2:41 PM, _Sielu said: rly guys?XD dev just use brain its easy to fix.. for example look for keys map (without fix) (with my fix) rly easy.. What Verdana? Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 1 Link to comment Share on other sites More sharing options...
_Sielu 13 Posted June 29, 2019 Share Posted June 29, 2019 17 minut temu, T4UMP napisał: Co Verdana? this is fix for all fonts and codepages Link to comment Share on other sites More sharing options...
Premium Lufbert 20 Posted July 11, 2019 Premium Share Posted July 11, 2019 Im proud somebody finally start working on that annoying metin bug. I have tried to fixed it some time ago but without any effect. Unfortunately your fix seems not work for me too. btw. @_Sielu if you managed to fix can you just give us any hint? I respect that you do it for customer so i dont want ready solution just a little hint Link to comment Share on other sites More sharing options...
Active Member enzi 842 Posted November 15, 2019 Active Member Share Posted November 15, 2019 Still no more fixes? Link to comment Share on other sites More sharing options...
ElRenardo 25 Posted November 15, 2019 Share Posted November 15, 2019 Hi, I saw this topic up again and so I took a few minutes to think about it. As you can see on the images posted before, the "dot" seems to appear only on the right edge of a character. I managed to fix arial and tahoma latin alphabet by reducing the vertices right and bottom from 0.5. You will have to do the same for the Outline rendering. I cannot paste the code here myself as I don't have the original file and I did modify the rendering method before. Please let me know if it's working in other alphabets too. Link to comment Share on other sites More sharing options...
Active Member enzi 842 Posted November 16, 2019 Active Member Share Posted November 16, 2019 17 hours ago, ElRenardo said: Hi, I saw this topic up again and so I took a few minutes to think about it. As you can see on the images posted before, the "dot" seems to appear only on the right edge of a character. I managed to fix arial and tahoma latin alphabet by reducing the vertices right and bottom from 0.5. You will have to do the same for the Outline rendering. I cannot paste the code here myself as I don't have the original file and I did modify the rendering method before. Please let me know if it's working in other alphabets too. I tried tons of fixes and no one helps me.. Im tired of finding solutions for this.. Im trying it more than year but nothing works for me If someone can help me I will pay for it.. 1 Link to comment Share on other sites More sharing options...
Dutschke 235 Posted November 16, 2019 Share Posted November 16, 2019 19 hours ago, ElRenardo said: Hi, I saw this topic up again and so I took a few minutes to think about it. As you can see on the images posted before, the "dot" seems to appear only on the right edge of a character. I managed to fix arial and tahoma latin alphabet by reducing the vertices right and bottom from 0.5. You will have to do the same for the Outline rendering. I cannot paste the code here myself as I don't have the original file and I did modify the rendering method before. Please let me know if it's working in other alphabets too. Can u share pls? Link to comment Share on other sites More sharing options...
_Sielu 13 Posted November 16, 2019 Share Posted November 16, 2019 fast fix with small logic int i_add = (strstr(m_fontName, "Tahoma") == 0) ? 1 : 0; //for more fonts TextOutW(hDC, m_x + i_add, m_y, &keyValue, 1); 6 Link to comment Share on other sites More sharing options...
Recommended Posts