What do you mean, change the font size in the command prompt, or in the text file you're piping it to?
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
>i want to mean , the change the size in text file
Oh I don't know about that. I would probably pipe it to a *.html file instead.
It allows you to easily change the font, and it's size amongst other things.
For example write this to a html file, which is essentially just saving it with the .html extension...
hello
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
i am generating report in text file from c language .
and i want fits all columns in a page so i want to reduce the size of text.
Plz help me out...
Ashish
Ok then, well how about you just open notepad, which I assume is the text editor you are using and change the font size to something smaller.
Then your program should, by default write to your files using the font size and style. I think?
I always set it to lucida console font size 10, it helps when you're aligning columns.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Sorrie kiddo you're loosing me now.
That's as much as I know. When you've finished the C program can't you just manually change it back to your original font size. I don't see what the problem is?
Also in notepad if you uncheck wordwrap you can fit all the columns on the page and just use the scrollbars to view it all.
Format>wordwrap
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
Erm, you can only set the font size and font whatever if you save the file in a format that provides some extension on formatting, say, like Rich-Text Format (RTF), Hypertext Markup Language (HTML and/or XHTML), Microsoft Word Document, or Portable Document Format (PDF). In other words, you will have to research on one of these formats, and implement them into your C program. I suggest you go with HTML because it's probably the easiest. If you want to work with other formats, try searching Google for their format specification. Alternatively, you can try searching for libraries already written that will write into the format of desire.
Hope this helps.
AstroNox
Junior Poster in Training
50 posts since Mar 2006
Reputation Points: 10
Solved Threads: 2
If you mean you want to change front at a laser printer attached directly to your computer or on a network -- that is a pretty complex topic all in itself. There are several c++ classes that can make it somewhat easier, and all require more advanced knowledge of c++. Here is probably one of the more easier examples.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
If it's an html file then just open it through your C code and append after beginning body tag and before closing body tag.
that will work ok in a web browser, but I don'tthink a laser printer or other text editors such as Notepad will interpret it. It will just simply print the tags as you typed them.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
that will work ok in a web browser, but I don't think a laser printer or other text editors such as Notepad will interpret it. It will just simply print the tags as you typed them.
It will work as long as you open it up as a .html in your web browser. Like you said if you open it up from notepad it won't, but that should be obvious? Try it and see.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
It will work as long as you open it up as a .html in your web browser. .
I thought that was what I said. However, the OP needs to clarify his question -- print to what? have a browser display the text on the screen or print it on a printer?
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I thought that was what I said. However, the OP needs to clarify his question -- print to what? have a browser display the text on the screen or print it on a printer?
I thought that's what I said, fourth post down, it seems people like repeating me. ;)
It's true though the OP needs to clarify what he means. I suspect his problem is something altogether different.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
I guess no further explaination is needed required for the OP's initial requirement.
He needs to
1. Print the results to a text file
2. Change the font size that is written in to the text file.
Astronox's answer is the most complete regarding these requirements.
You cant change the font size written in to the text file, because NO font formatting information, like Bold, italic, underline can be stored in the text file. A text file stores only the text information. Not the glyph information. The only formatting possible are the ones done with newlines, tabs ... So a big NO YOU CAN'T DO THAT will do.
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
[satire]
>You can't change the font size written in to the text file
Of course you can, not from the c program of course, but you do so from notepad directly. It's just that the entire file will be that size. I think that's all he wants. Just for it to fit into an A4 sheet or something so he can print it off from the printer?
>Astronox's answer is the most complete regarding these requirements.
Maybe, but I was alluding to that with my .html example...so there!
>I guess no further explaination is needed required for the OP's initial requirement.
Maybe you can understand gibberish kiddo... :rolleyes:
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
>You can't change the font size written in to the text file
Of course you can, not from the c program of course, but you do so from notepad directly. It's just that the entire file will be that size. I think that's all he wants. Just for it to fit into an A4 sheet or something so he can print it off from the printer?
Hah. That doesnt change the font size in the text file. Because the text file does not have a font size. You are only changing the font size of the viewer program. What you are saying is like, looking at a paper through a magnifying glass and saying that the font size of the paper has got bigger.>I guess no further explaination is needed required for the OP's initial requirement.
Maybe you can understand gibberish kiddo... :rolleyes:
Maybe you can't understand the answers given to your own questions.
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
[satire]
>Hah. That doesnt change the font size in the text file. Because the text file does not have a font size. You are only changing the font size of the viewer program.
Oh wow, let's all be pedantic!
>Maybe you can't understand the answers given to your own questions.
Like I said, you can understand gibberish, well done!
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
>Hah. That doesnt change the font size in the text file. Because the text file does not have a font size. You are only changing the font size of the viewer program.
Oh wow, let's all be pedantic!
That is just running away without an explaination, and off topic, and maybe just serves to increase youarethwee's :rolleyes: post count.
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115