- Katılım
- 6 Mayıs 2022
- Konular
- 48,266
- Mesajlar
- 48,576
- Tepkime puanı
- 74
- M2 Yaşı
- 3 yıl 11 ay 10 gün
- Trophy Puan
- 48
- M2 Yang
- 488,629
Kod:
GrpFontTexture.cpp /// 1. // Search #include "Util.h" // Add below #define __FONT_TEXTURE_FIX__ // Adds padding to prevent random dots in font textures. /// 2. // Search @ CGraphicFontTexture::GetFont logFont.lfOutPrecision = OUT_DEFAULT_PRECIS; // Replace with #if defined(__FONT_TEXTURE_FIX__) logFont.lfOutPrecision = OUT_TT_PRECIS; #else logFont.lfOutPrecision = OUT_DEFAULT_PRECIS; #endif /// 3. // Search @ CGraphicFontTexture::TCharacterInfomation* CGraphicFontTexture::UpdateCharacterInfomation int width = m_dib.GetWidth(); int height = m_dib.GetHeight(); // Add below #if defined(__FONT_TEXTURE_FIX__) const int padding = 1; #endif /// 4. // Search @ CGraphicFontTexture::TCharacterInfomation* CGraphicFontTexture::UpdateCharacterInfomation if (m_x + size.cx >= (width - 1)) // Replace with #if defined(__FONT_TEXTURE_FIX__) if (m_x + size.cx + padding >= (width - 1)) #else if (m_x + size.cx >= (width - 1)) #endif /// 5. // Search @ CGraphicFontTexture::TCharacterInfomation* CGraphicFontTexture::UpdateCharacterInfomation if (m_y + size.cy >= (height - 1)) // Replace with #if defined(__FONT_TEXTURE_FIX__) if (m_y + size.cy + padding >= (height - 1)) #else if (m_y + size.cy >= (height - 1)) #endif /// 6. // Search @ CGraphicFontTexture::TCharacterInfomation* CGraphicFontTexture::UpdateCharacterInfomation m_x += size.cx; // Replace with #if defined(__FONT_TEXTURE_FIX__) m_x += size.cx + padding; #else m_x += size.cx; #endif I also decided to use `OUT_TT_PRECIS` over `OUT_DEFAULT_PRECIS` because, after some research, I learned that it provides better rendering, especially for scaling, anti-aliasing, and glyph alignment.
Client Partiküllü Text Fix Nedir?
Metin2 özel sunucularında geliştirme yaparken bazı görsel sorunlarla karşılaşabilirsiniz. Bunlardan birisi de 'partiküllü text' sorunudur. Bu durumda yazılar ekranda parçacıklar gibi görünür, okunaklılığı düşer ve kullanıcı deneyimi bozulur. Bu yazıda client partiküllü text fix konusunu detaylıca ele alacağız ve çözüm önerileri sunacağız.
Partiküllü Text Nedir ve Neden Oluşur?
Partiküllü text, Metin2 istemcisinin yazı fontlarını doğru şekilde render etmemesi sonucu oluşur. Bu genellikle yanlış font ayarları, eksik veya bozuk texture dosyaları, veya client tarafında yapılan bazı modifikasyonlar sebebiyle meydana gelir. Bu problem özellikle C++ client src[/COORD] üzerinde değişiklik yapan geliştiriciler için daha sık karşılaşılan bir sorundur.
Sorunun Kaynağı ve Belirtileri
Bu hata şu belirtilerle ortaya çıkar:
- Oyun içindeki yazıların net olmaması
- Harf kenarlarında kırık, pürüzlü görünümler
- Özellikle küçük yazıların okunaksız hale gelmesi
- Menü ve GUI elementlerinde bozulma
Bu tür sorunlar genellikle uiscript ve py root dosyalarında yapılan düzenlemelerle ilişkilidir.
Partiküllü Text Sorununu Çözme Yöntemleri
1. Font Dosyalarının Doğru Ayarlanması
Metin2 client içinde kullanılan font dosyalarının doğru şekilde yerleştirilmiş ve güncel olduğundan emin olunmalıdır. Bu dosyalar genellikle localeasicont klasöründe bulunur. Buradaki .ttf uzantılı font dosyalarının doğru şekilde paketlenmiş olduğundan emin olun.
2. Texture Cache Temizliği
Oyun başlatılırken fontların doğru şekilde yüklenmesi için texture cache temizlenmelidir. Bunu yapmak için oyun ayarlarından 'Grafik Ayarları' kısmına giderek önbelleği temizleyin veya doğrudan cache klasörünü silin.
3. Render Ayarlarının Kontrolü
DirectX veya OpenGL ayarları da font renderlamayı etkileyebilir. Deneme yanılma yöntemiyle farklı render modları test edilmelidir.
4. Client Kodlarında Font Ayarlarını Kontrol Etme
Eğer client src üzerinde değişiklik yapıyorsanız, font renderlama kodlarının doğru şekilde ayarlandığından emin olun. Özellikle C++ tabanlı clientlerde GUI layer ve text renderer sınıfları incelenmelidir.
Python GUI ile Entegrasyon
Metin2 client tarafında GUI elementlerinin çoğu Python GUI sistemleri ile oluşturulur. Bu sistemlerde font renderlama işlemleri py gui dosyalarında tanımlanır. Eğer bir GUI elementinde partikül sorunu yaşıyorsanız, ilgili .py dosyasındaki font ayarlarını kontrol edin.
Fix Uygulama Örneği
Aşağıda örnek bir font ayar kodu verilmiştir:
ui.SetFontName('Arial', 12)
Bu satır doğru font adını ve boyutunu belirtmelidir. Yanlış yazılmış bir font ismi veya desteklenmeyen bir font, partikül sorununa neden olabilir.
Sonuç
Client partiküllü text fix işlemi, Metin2 özel sunucularında kullanıcı deneyimini artırmak için önemli bir adımdır. Bu sorun genellikle küçük yapısal değişikliklerle çözülebilir. Geliştiricilerin dikkat etmesi gereken başlıca konular; doğru font kullanımı, cache yönetimi ve GUI kodlarında dikkatli olunmasıdır. Bu yönergeleri takip ederek partikül sorununu başarıyla çözebilirsiniz.
Not: Bu fix işlemi sırasında source edit ve compile işlemleri gerektirebilir. Her değişiklikten sonra test yapmanız önerilir.
What Is Client Particulated Text Fix?
While developing on Metin2 private servers, you may encounter certain visual issues. One of these is the 'particulated text' issue. In this case, texts appear on screen like particles, readability decreases, and user experience deteriorates. In this article, we will examine the subject of client particulated text fix in detail and provide solution proposals.
What Is Particulated Text and Why Does It Occur?
Particulated text occurs when the Metin2 client fails to properly render text fonts. This usually happens due to incorrect font settings, missing or corrupted texture files, or modifications made on the client side. This issue is more frequently encountered among developers who modify C++ client src.
Source and Symptoms of the Problem
This error manifests itself with the following symptoms:
- Unsharpness in in-game texts
- Jagged or rough appearances at letter edges
- Small texts becoming unreadable
- Distortion in menus and GUI elements
These types of issues are generally associated with modifications made in uiscript and py root files.
Methods for Resolving Particulated Text Issues
1. Correct Setup of Font Files
Ensure that font files used within the Metin2 client are correctly placed and up-to-date. These files are typically located in the locale\basic\font folder. Make sure that the .ttf font files are properly packed.
2. Clearing Texture Cache
To ensure fonts load correctly upon starting the game, clear the texture cache. You can do this by going into 'Graphics Settings' in the game and clearing the cache or directly deleting the cache folder.
3. Checking Render Settings
DirectX or OpenGL settings can also affect font rendering. Different render modes should be tested using trial and error methods.
4. Checking Font Settings in Client Code
If you are making modifications to client src, ensure that font rendering codes are set correctly. Especially in C++-based clients, GUI layer and text renderer classes should be reviewed.
Integration with Python GUI
Most GUI elements on the Metin2 client side are created with Python GUI systems. Font rendering operations in these systems are defined in py gui files. If you're experiencing particle issues in a GUI element, check the font settings in the relevant .py file.
Example Fix Implementation
Below is an example of font setting code:
ui.SetFontName('Arial', 12)
This line must specify the correct font name and size. A misspelled font name or unsupported font can cause particle issues.
Conclusion
Client particulated text fix is an important step in improving user experience on Metin2 private servers. This issue can often be resolved with small structural changes. Main topics developers should pay attention to include correct font usage, cache management, and being careful in GUI code. By following these guidelines, you can successfully resolve the particle issue.
Note: This fix process may require source edit and compile operations. Testing after every change is recommended.
