Hack Forums
Font renderer fuckery. - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: General Topics (https://hackforums.net/forumdisplay.php?fid=7)
+--- Forum: Entertainment (https://hackforums.net/forumdisplay.php?fid=446)
+---- Forum: Gaming (https://hackforums.net/forumdisplay.php?fid=65)
+---- Thread: Font renderer fuckery. (/showthread.php?tid=5519792)



Font renderer fuckery. - PersonOfThePeoples - Jan 10, 2017

Hi. I've been working on a non-bitmap based ttf font renderer for a while but today I noticed that some characters render oddly sometimes. i(dot)imgur(dot)com/Wij7mCO(dot)png I made my arraylist just "iii" to show the problem, every 5 strings it will render the 'i' without the gap. I'm assuming its opengl scaling not scaling it the way I want it to. This also makes the shadow a bit bigger, which I also think is a scaling problem.

Heres the code :
pastebin(dot)com/raw/Kjx1aaET (Sorry for extreme over-documentation)

Anyone have any ideas on how I could fix this?


* - rederpz - Jan 10, 2017

I think I see your problem here, in your links you have (dot) instead of . try using a . instead and maybe the I's will render properly?

If this doesn't work, maybe you are using an L instead of an I?


* - PersonOfThePeoples - Jan 10, 2017

(Jan 10, 2017 11:38 AM)Rederpz Wrote:  snippo

Shit man your right.


* - Ygore - Jan 10, 2017

(Jan 10, 2017 11:48 AM)PersonOfThePeoples Wrote:  Shit man your right.

You're*


* - rederpz - Jan 10, 2017

(Jan 10, 2017 12:33 PM)Ygore Wrote:  You're*

no stupid he said its my right you don't say it's you are right you dingle


* - |Foundry - Jan 10, 2017

I cleaned up the formatting of the code for anyone interested in taking a look at it. You can find it here, in all of its comment-free and indented glory.
Just a general note, don't comment like this. Comments in your code should be the exception for circumstances in which you've made some truly interesting functionality deserving of a more in-depth explanation. Instead of clarifying the intention of the code, the comments here just obscure it. I mean come on.


* - rederpz - Jan 10, 2017

(Jan 10, 2017 04:20 PM)|Foundry Wrote:  snip

ok ill look at it now

PHP Code

<?php 
private static final int MARGIN = 4;
    private static final 
char COLOR_INVOKER = '\247';
    private static 
int RANDOM_OFFSET = 1; 

constants??????


PHP Code

<?php 
public TTFFontRenderer(Font font, int characterCount) {
        
this(font, 256, false);
    } 

this parameter is not necessary sir


PHP Code

<?php 
GL11
.glBegin(GL11.GL_QUADS); {
            
GL11.glTexCoord2f(0, 0);
            
GL11.glVertex2d(x, y);
            
GL11.glTexCoord2f(0, 1);
            
GL11.glVertex2d(x, y + charData.height);
            
GL11.glTexCoord2f(1, 1);
            
GL11.glVertex2d(x + charData.width, y + charData.height);
            
GL11.glTexCoord2f(1, 0);
            
GL11.glVertex2d(x + charData.width, y);
        }
        
GL11.glEnd(); 

this looks stupid to me


in conclusion the issue may be with ur shadows question mark or idk


* - JeffViato - Jan 11, 2017

Why not just make use of Minecraft's DynamicTexture class?


* - ddong - Jan 11, 2017

(Jan 10, 2017 11:38 AM)Rederpz Wrote:  I think I see your problem here, in your links you have (dot) instead of . try using a . instead and maybe the I's will render properly?

If this doesn't work, maybe you are using an L instead of an I?

any eta when you're gonna start going outside and doing something?


* - rederpz - Jan 12, 2017

(Jan 11, 2017 11:56 PM)Ddong Wrote:  any eta when you're gonna start going outside and doing something?

when outside comes to me fam too lazy


* - ddong - Jan 13, 2017

(Jan 12, 2017 10:53 AM)Rederpz Wrote:  when outside comes to me fam too lazy

yeah i've noticed from various pictures