I’m using GD to change the font on user posted comments. What I have so far works for a single post but what I need are all of the posts output into a single image. Is this possible?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t use GD. Instead, use CSS to control fonts. For instance, output your comment inside a div with a class:
And then in your CSS:
What this will do is force the font inside your comment to Courier New, even if the comment contains HTML that uses the
<font>tag or specifies font in astyleattribute.The first style rule says that all
<div>elements with the classcommentwill use Courier New as its font. The second rule tells all descendants of that div (ie. any elements within the div) to inherit the font styling, and!importanttells the browser that that rule should overrule any otherfont-familyrule on the element.Update based on your comment:
If you want to use a font that you think most users won’t have, you can still solve this with CSS, by specifying an
@font-facedeclaration and hosting the font file on your server.Take a look at Bulletproof @font-face syntax for an example of how you can use
@font-facein a cross-browser way. There’s also a @font-face generator that you can use.