Couldn't you do partial rendering by just changing the second check to use the right side of the glyph (i.e. x+w)? In any case this is not GUI-only code so I guess someone should take a look at it and make sure it doesn't cause problems for any engines.