Why is it when I upload a plain text file to a server, it displays (in Safari) using the courier font, and when I output from a php it shows as Times?
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.
Plain text is plain text. It carries no formatting information of its own, and the browsers will decide how to display it. Displaying a file directly, the web server will supply it with a mime type
text/plain. This will often instruct the browser to use a fixed width font (Courier). But if you output it with PHP, the server is sending it astext/html(HTML) and the browser is using its default font for HTML (Times, in your case).For the plain text, you don’t have any control over how the end user’s browser will render it. That setting is entirely up to browser defaults or user preferences. Of course, you can influence how it is displayed as HTML when output by PHP with CSS declarations.