Printer font, setting

In preferneces I can set the visual font in the IDE. (I also found how to play with it in the prefernces.txt file)

Where/how can i set the printer font?

The printer font I get is the same as the visual font, just much larger. (I'd guess point 24, when the visual is point 12)

Let me ask the question another way :wink:

When you use File Print in the IDE, how does your printout look? On my printout the font is far too large, some scaling has gone wrong. It is so large I only see part of the code, the rest has spilled off the page both top and right.

Known bug? Version 18 (window)

For me, the font is a bit large. HP LaserJet P1102W.

I am just getting started with Arduino and I have just run smack into the brick wall that Msquare spoke of. I can't believe there aren't any parameters in the Preferences.txt file that relate to printing ... :-[

Doesn't anyone ever print out their source code??? If so, how do you do it? I tried copying my source code into a Rich Text Format (.rtf) file because that's a trick that's worked for me before with another language's IDE that had crappy printing capability, but no luck with Arduino source code. All the color formatting gets stripped away.

Before that I tried just instructing my printer to downscale the printed page, but evidently the Arduino IDE only sends a certain number of characters per line, not the entire line. So half my source code goes straight into the Great Bit Bucket in the Sky.

Does anybody know how to get decent printout of Arduino source code?

without knowing the printer I am not sure.

If this is a cheap USB printer my knowledge is limited but with larger laser devices I may be able to help a little more.

We will never know if you do not post the type of printer and a driver version number.

The printer is a Canon Pro9000 Mark II which is indeed a USB printer, but is hardly what anyone would call cheap, as it set me back $430 USD; at least until my supposed $100 rebate gets here anyway.

Copiertalk, I'd be glad of any help, to be sure. But setting up the printer per se is not the problem. The problem is (1) seemingly the IDE cannot be made to send any setup data to the printer, and (2) it does not send a full line of source code to the printer; it sends only as many characters as it thinks will fit on a printed line.

If it wasn't for that 2nd part of the problem, I could set up the printer manually, telling it to scale the page so as to fit the text to the page width but as I said, the IDE does not send a full line, so no matter how I set up the printer, I won't get all the text that's on each line unless I am content to use only tiny short little lines of source code, which I am not about to do.

The real problem of course is that there are no parameters in the Preferences.txt file for printing; evidently whoever created the IDE didn't think printing out source code was important enough to bother with, which is difficult to understand. Or at least for me it is. You'd think there'd at least be a parameter that could shut off that stupid line truncation.

Then again, I'm a real newbie at Arduino; perhaps there actually is a way of obtaining good printed output and I'm just unaware of it. I'm hoping that's the case, and that someone will know what to do about this. Either that or maybe the powers that be will notice this problem and do something about it. I sure hope so.

Just off the cuff, change the output to landscape instead of portrait. if it is a paper size problem or an orientation problem it will change the symptom at least and give us a direction to look into the issue a little further.

I will see what I can dig up on the driver when I get to the shop for you.

You are correct. cheap was probably not the correct term. Inexpensive would probably be better in this context. I just get so many questions on how to integrate an office depot or office max $39 printer that I sometimes embed that in my mind first rather than the question at hand. My appologies for doing that.

What type of driver? ufrII by chance?

I tried it with 11" x 17" paper, to get it to send the entire line's worth of characters, but even that wasn't enough. And of course you can set the editor font smaller and then it uses that same font size for printing, but when you do the printing becomes so faint it's barely legible (it prints very faintly to begin with). Another problem I've found is that no matter what left margin you specify, you get a one-inch margin. The bottom line is that it's not going to work correctly until somebody fixes the IDE. I'll just have to go without printing the source code, like everybody else evidently.

I'll just have to go without printing the source code, like everybody else evidently.

Not really a fix, but have you tried copy/paste to Word (or whatever you use), switching the font to a fixed-width font, then printing from that?

:slight_smile:

crOsh, one problem with doing that is that the act of copy-and-paste drops all the (color) formatting information, as noted in my first post above. That's still better than nothing perhaps, but it's a poor substitute for the real thing, IMHO. Besides, the real solution is for whoever maintains the IDE to fix the printing problem in the first place. Doing so does not require rocket science and it would certainly be a desirable and useful feature.

@Lazy Raptor
A lot of the IDE code is common to Processing. All of it is open source.

Seeing as how fixing it is not rocket science, why don't you fix it, and submit the fixes for incorporation into the next release of the Processing and Arduino iDEs?

... and the crowd roars its approval as PaulS hits one right out of the stadium!

Good one, Paul ... now I'm nicely hoist by my own petard, hm? :wink:

Okay, okay, you have a point there I suppose, and I expect I could've been a bit more, ah, dispassionate? tolerant? Something.

But hey, I'm retired now, and it'll be a very cold day in Cleveland before I do as you suggest, sorry.

Besides, I was a mainframe guy; any computer that's smaller than Kansas and weighs less than Oprah is outside my sphere of influence, you might say. I promise I'll stop kvetching about the printing feature of the IDE. Honest. Seriously though, I didn't mean to ruffle any feathers, it's just that I tend to be a bit more, er, expressive than most people. Or maybe it's just a case of (somewhat) premature senility, yeah, that's it, I'm just a helpless victim of my advancing age, and you young whippersnappers should be less inclined to goad the old bull as he blunders around the pasture. So there.

Anyway, I do take your point, Paul. Besides, to be perfectly honest, even I don't print out source code half as much as I used to in days of yore. Or maybe it's just that I bought this fancy-schmancy expensive printer that can practically redo the ceiling of the Sistine chapel all by itself and so now quite naturally I've become something of a "printer snob".

I don't print out source code from the Arduino very often. When I do, it's on a laser printer (black on white paper). So, maintaining color is not, for me, an issue.

I also use very short statements.

I'm
aware
that
the
compiler
ignores
white
space.

So, if the printer is lopping some lines off, there is a solution. Besides, it's easier to read and modify code if the screen isn't jumping back and forth as the cursor moves from one end of the line back to the beginning as well as up when a new line is added.

I think that the commonality with the Processing user interface is a good thing. But, all that that means is that printing in both applications sucks.

Using Java to design user interfaces is a bit like hammering screws in. It sort of appears to work, but not as well as a real GUI tool. Separating the model (the code), the view (what you see on the screen) and the controller (adding new code, cut and paste, insert/overwrite, etc.) seems more difficult.

The only thing that Java has going for it is that it is supported everywhere, fairly consistently.

There are other cross-platform GUI tools available. Some are even open source. It's really time to abandon the Java-based GUI, and develop a real IDE.

The other issues that have been offered as suggestions (code folding, different keys for cut and paste, etc.) could be incorporated at the same time.

Notepad++ has been suggested as a good foundation for the source code processing part of the IDE. Unfortunately, while Notepad++ IS open source, the user interface is not Linux or Mac compatible. But, perhaps the model and controller parts of the ModelViewController paradigm could be borrowed from Notepad++ with a different view implementation.