Terminfo question: how do I print text in RED

Hi. Really basic question here, but I've spent hours trying to solve it.
I have a Terminal application. I want to make some text appear as RED. I do not want to hard-code the escape characters, I want to do it with terminfo.
I've read through the documentation many times and just can't figure it out. Any ideas?

Well, I figured it out!
Here is a code snipped which prints all of the termcap color:
char *setf = tigetstr("setf");
if(!setf) setf = tigetstr("setaf");
for(int i=0;i<16;i++){
putp(tparm(setf,i));printf("Color %d\n",i);
putp(tparm(setf,0));
Red is color 1

Similar Messages

  • How can i print text messages from my htc amaze to my deskjet 3050A

    how can i print text messages from my htc amaze to my hp deskjet 3050A

    Hi,
    I believe the phone uses Android OS, v2.3.4 (Gingerbread) therefore you can use one of these applications:
       http://www.printeron.com/apps/androidprinting.html
       https://market.android.com/details?id=com.pauloslf​.cloudprint&hl=en
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How can i print text message from my iPhone?

    I have an iPhone 5S.  How can I print text messages to save those conversations?

    Did you try to copy and paste the content into another app, like notes or Mail and then send it to the printer?

  • How can I print texts from iPhone4 to Canon MX870

    How can I print texts from iPhone4 to Canon MX870

    The following gives instructions. http://support.apple.com/kb/HT4517
    Note that your carrier may not support it or may have added charges.
    To use this feature, enable Personal Hotspot on your cellular data plan. Contact your carrier for information and pricing.

  • How can i print text contain multiple language

    hi all,
    i have swing application with JTextPane contains multiple data (kannada and English)
    i used to the follwoing code to print contatent of jtextPane and in this code i seted
    font Kedage(for kannada)
    if did not set to kannada font the kannada test is printing squre box
    if i set english font than kannada the english font is squre box,
    here how can i identify the the character is kannada and english
    help me to solve this problem or suggest me any other way to print multiple language
    text in JTextPane.
         public void printMeetingDetails(String meetingDate){
                   PrintJob pjob = getToolkit().getPrintJob(new JFrame(), "Meeting Details", new Properties());
                    if (pjob != null) {
                      Graphics pg = pjob.getGraphics();
                      if (pg != null) {
                        String s1 = taMeetingDetails.getText();
                        s1 = s1 + "\n Resolution :";
                        //String s2 = "\n This is the second paragraph for printing after the sample java code.";
                        String s2 = "\t"+taResolution.getText();
                        printLongString (pjob, pg, s1,s2);
                        pg.dispose();
                      pjob.end();
              private int margin = 72;
                // Print string to graphics via printjob
                // Does not deal with word wrap or tabs
                private void printLongString (PrintJob pjob, Graphics pg, String strEng,String strKan) {
                  int pageNum = 1;
                  int linesForThisPage = 0;
                  int linesForThisJob = 0;
                  // Note: String is immutable so won't change while printing.
                  if (!(pg instanceof PrintGraphics)) {
                    throw new IllegalArgumentException ("Graphics context not PrintGraphics");
                  StringReader srEng = new StringReader (strEng);
                  StringReader srKan = new StringReader (strKan);
                  LineNumberReader lnrEng = new LineNumberReader (srEng);
                  LineNumberReader lnrKan = new LineNumberReader (srKan);
                  String nextLine;
                  int pageHeight = pjob.getPageDimension().height - margin;
                // Font helv = new Font("Kedage", Font.PLAIN, 12);
                  Font helv = new Font("Kedage", Font.PLAIN, 12);
                  //have to set the font to get any output
                  pg.setFont (helv);
                  FontMetrics fm = pg.getFontMetrics(helv);
                  int fontHeight = fm.getHeight();
                  int fontDescent = fm.getDescent();
                  int curHeight = margin;
                  try {
                    do {
                      nextLine = lnrEng.readLine();
                      if (nextLine != null) {        
                        if ((curHeight + fontHeight) > pageHeight) {
                          // New Page
                          System.out.println ("" + linesForThisPage + " lines printed for page " + pageNum);
                          if (linesForThisPage == 0) {
                             System.out.println ("Font is too big for pages of this size; aborting...");
                             break;
                          pageNum++;
                          linesForThisPage = 0;
                          pg.dispose();
                          pg = pjob.getGraphics();
                          if (pg != null) {
                            pg.setFont (helv);
                          curHeight = 0;
                        curHeight += fontHeight;
                        if (pg != null) {
                          pg.drawString (nextLine, margin, curHeight - fontDescent);
                          linesForThisPage++;
                          linesForThisJob++;
                        } else {
                          System.out.println ("pg null");
                    } while (nextLine != null);
                    Font fMyFont = new Font("Kedage", Font.PLAIN, 12); //for kannada
                    //have to set the font to get any output
                    pg.setFont (fMyFont);
                    fm = pg.getFontMetrics(fMyFont);
                    fontHeight = fm.getHeight();
                    fontDescent = fm.getDescent();
                    curHeight += fontHeight;
                    do {
                      nextLine = lnrKan.readLine();
                      if (nextLine != null) {        
                        if ((curHeight + fontHeight) > pageHeight) {
                          // New Page
                          System.out.println ("" + linesForThisPage + " lines printed for page " + pageNum);
                          if (linesForThisPage == 0) {
                             System.out.println ("Font is too big for pages of this size; aborting...");
                             break;
                          pageNum++;
                          linesForThisPage = 0;
                          pg.dispose();
                          pg = pjob.getGraphics();
                          if (pg != null) {
                            pg.setFont (fMyFont);
                          curHeight = 0;
                        curHeight += fontHeight;
                        if (pg != null) {
                          pg.drawString (nextLine, margin, curHeight - fontDescent);
                          linesForThisPage++;
                          linesForThisJob++;
                        } else {
                          System.out.println ("pg null");
                    } while (nextLine != null);
                  } catch (EOFException eof) {
                    // Fine, ignore
                  } catch (Throwable t) { // Anything else
                    t.printStackTrace();
                }thanks
    daya

    hi all,
    i have swing application with JTextPane contains multiple data (kannada and English)
    i used to the follwoing code to print contatent of jtextPane and in this code i seted
    font Kedage(for kannada)
    if did not set kannada font then kannada text is not printing porperly(printg squre box)
    if i set kannada font then english font is squre box,
    here how can i identify the the character is kannada and english characater
    help me to solve this problem or suggest me any other way to print content of jtextpane which is in multiple language text.
    public void printMeetingDetails(String meetingDate){
                   PrintJob pjob = getToolkit().getPrintJob(new JFrame(), "Meeting Details", new Properties());
                    if (pjob != null) {
                      Graphics pg = pjob.getGraphics();
                      if (pg != null) {
                        String s1 = taMeetingDetails.getText();
                        s1 = s1 + "\n Resolution :";
                        //String s2 = "\n This is the second paragraph for printing after the sample java code.";
                        String s2 = "\t"+taResolution.getText();
                        printLongString (pjob, pg, s1,s2);
                        pg.dispose();
                      pjob.end();
              private int margin = 72;
                // Print string to graphics via printjob
                // Does not deal with word wrap or tabs
                private void printLongString (PrintJob pjob, Graphics pg, String strEng,String strKan) {
                  int pageNum = 1;
                  int linesForThisPage = 0;
                  int linesForThisJob = 0;
                  // Note: String is immutable so won't change while printing.
                  if (!(pg instanceof PrintGraphics)) {
                    throw new IllegalArgumentException ("Graphics context not PrintGraphics");
                  StringReader srEng = new StringReader (strEng);
                  StringReader srKan = new StringReader (strKan);
                  LineNumberReader lnrEng = new LineNumberReader (srEng);
                  LineNumberReader lnrKan = new LineNumberReader (srKan);
                  String nextLine;
                  int pageHeight = pjob.getPageDimension().height - margin;
                // Font helv = new Font("Kedage", Font.PLAIN, 12);
                  Font helv = new Font("Kedage", Font.PLAIN, 12);
                  //have to set the font to get any output
                  pg.setFont (helv);
                  FontMetrics fm = pg.getFontMetrics(helv);
                  int fontHeight = fm.getHeight();
                  int fontDescent = fm.getDescent();
                  int curHeight = margin;
                  try {
                    do {
                      nextLine = lnrEng.readLine();
                      if (nextLine != null) {        
                        if ((curHeight + fontHeight) > pageHeight) {
                          // New Page
                          System.out.println ("" + linesForThisPage + " lines printed for page " + pageNum);
                          if (linesForThisPage == 0) {
                             System.out.println ("Font is too big for pages of this size; aborting...");
                             break;
                          pageNum++;
                          linesForThisPage = 0;
                          pg.dispose();
                          pg = pjob.getGraphics();
                          if (pg != null) {
                            pg.setFont (helv);
                          curHeight = 0;
                        curHeight += fontHeight;
                        if (pg != null) {
                          pg.drawString (nextLine, margin, curHeight - fontDescent);
                          linesForThisPage++;
                          linesForThisJob++;
                        } else {
                          System.out.println ("pg null");
                    } while (nextLine != null);thanks
    daya

  • How do I print text in draft mode in CS5.5?

    I'm sure this is really simple, but I'm stumped, and I haven't been able to find instructions online. A page of text I'm trying to print prints at the highest quality no matter what I do to try to change the settings. Not only is it wasting ink, but it's taking forever to print just a few paragraphs. I saw a reference in an online forum about printing in draft mode, but no instructions on how to do it. Does anyone know? Thanks.

    Thanks. I meant to get back to you sooner but I've been busy. I'll have to consider looking into a laser again at some point. Last time I looked was several years ago, and prices for what I wanted (color, oversize printing, envelope printing, color photocopying) were higher than I wanted. If it would save me money to buy just an 8 1/2 x 11 monochrome for printing emails and stuff, though, maybe I should consider it. I'm doing a lot less photo printing than I used to. I also didn't want to take up more space by having two printers, but if the savings were significant it might be worth it.

  • How to read printed text from the browser.

    I have an API that take 2 parameters as query string and after validating it prints back 4 parameters on the browser itself like :
    para1=abc
    para2=xyz
    para3=123
    para4=pqr
    now i want to use the value of these parameters further in my program, can anyone tell me how can i take the parameter values in variables.

    I can think of two choices offhand.
    1. In addition to displaying the values, have your servlet or JSP write out a form with <input type="hidden" name="para1" value="abc"> fields in it, and a submit button. Your values will come back to you in the next post or get request. (If this is sensitive information, however, DO NOT do this unless you can re-validate the data, since it would be possible for someone to fabricate their own static page to submit bogus data.)
    2. Put the data in the session object, using the setAttribute(...) method, and retrieve it on the next page using getAttribute(...).
    You cannot really "read" the page that is visible on the user's browser.
    Hope this helps.
    Cheers!
    Jerry Oberle

  • Newbie question: How do I cange text on the buttons from a template?

    I don't mind when it takes a while to figure out stuff that's really complicated, but it kills me when I can't get something that should be (and I'm sure is) easy. I have my first downtime since getting my Final Cuts bundle and am trying to figure out DVDSP using a menu template to start. I've managed to import all my assets, manage the navigation, change the title, add a slideshow, do looping and linking, and everything plays fine in the simulator. What I can't do is change the names from "Button 1" etc to appropriate names, ie "contact". I'm sure it's something really simple, but I'm not finding it. Any help out there?
    G5 Quad   Mac OS X (10.4.5)  

    Oh, inspector - text. OK, second time I've posted a question here after working forever on it then found it as soon as I posted.
    G5 Quad   Mac OS X (10.4.5)  

  • Table Question:  How do you make text in cell rotate?

    Hi....
    I'm working with tables for the first time.  I'm doing a publicity schedule with a simple table. 
    On the top row.....  I put in cells with diagonal lines, so I could fit it many publication along the top row.  I got the diagonal lines in there.  But, when I'm typing the names of the publications (that should go along those diagonal lines), at about 45 degree angle, it just types straight text that fills the cell.  What am I doing wrong, or how do I achieve what I'm trying to do???

    http://indesignsecrets.com/diagonal-headings-in-indesign-tables.php
    Look at the second comment for another method that may well work best for your purposes.
    Take care, Mike

  • CS3/4, JS Amateur question: how remove all empty text frames?

    I'm an amateur, and thought it would be a straightforward matter to write a script that simply deletes all empty text frames in all of a document's stories. Here's my second attempt:
    var myDocument = app.activeDocument;
    var myStories = myDocument.stories;
    for (i = 0; i < myStories.length; i++){
      var myStory = myStories[i];
      var myTextFrames = myStory.textContainers;
        for (j = myTextFrames.length - 1; j >=0; j--) {
        if (myTextFrames[j].contents == "") myTextFrames[j].remove();
    The trouble is, sometimes it works as intended, but sometimes, with multiple stories, it needs to be run more than once. Can anyone explain why that is?
    Thanks -- Jeremy

    [Jongware] wrote:
    (Bit of a Johnny-come-lately, but anyway )
    AHA! -- This is a great help. It was driving me up the wall, and I don't know why it didn't work for me last night. Maybe it's because I was counting through stories in the wrong direction. Anyhow, I see how it works now, and I'm very grateful for the help.
    By the way Harbs, I used all three of your suggestions because I had spent far too much time tapping away at that nut with my little toy hammer. I vented my frustration by using all three of your sledgehammers. In particular, I made sure it left a single empty text frame where it was, as such a frame might be used as a graphic. (Although in the past, I've found an empty story can be a sneaky place for a rogue font to hide. The insertion point just in front of the "end of story" character can have a paragraph style applied, with its associated font, but "Find" won't find any characters with that paragraph style or font applied!)
    Thanks to all again -- Jeremy

  • How do I print text document (spreadsheet) in 11 x 17 format with landscape orientation?

    Print preview shows only in portrait orientation when I get an image at all, then when I hit "print" icon, get instant message that says "out of memory".  Also cannot seem to get printer to recognize 11 x 17 size -- keeps saying that printer settings & paper size do not match.

    Don't want to come across as ungrateful, but I'm NOT impressed with how these postings are being handled.  Guess I should expect that with HP -- ever since their calculators came out with RPN, the culture of HP has been different from most others.
    To repeat myself, my printer is HP B8550 Photosmart, capable of wide format printing -- the reason I purchased this one after reading reviews by others  of all its features.  My OS is Windows XP Home Edition.  My problem is with trying to print out a spreadsheet format of a large genealogical database that I have created, using Windows Works.  When I open the file, create the desired printer settings, and perform the page set-up tasks, all I get when I hit "print preview" is an error message that says "out of memory", which prevents any further action.  When I clear that from the screen & try to see a print preview, I get a truncated image of the spreadsheet in PORTRAIT orientation & not the LANDSCAPE orientation that I have set the document printing for.
    While awaiting a useful response from yesterday's forum (& not getting one), I tried a different Word document while using the same 11 x 17 sheet size setting for the printer, & that document was processed without a hiccup.  I'm now more inclined to believe that there is something wrong with my Window Works software & NOT the printer software that just doesn't want to deal with 11 x 17 spreadsheets in queue or out on the stack (or heap -- wherever the machine stages such data for processing), but I just don't know.  Made a separate file using just one page of the database, thinking that maybe the 4.5 MB file size was the problem, but that had absolutely no effect on the situation -- it won't print even that small file as structured.  To display all the data, I need to use landscape orientation.  Puzzled why it won't show in that orientation even within print preview.
    ANY advice on how to get this project to work properly is appreciated -- it represents about 8 years' worth of work in creating it & I'm ready to make a hard copy to use while doing on-site work at various archives holding such records.

  • How do i print text message threads

    I would like to know if there is a way to print off a text message thread in a printer friendly format.

    Export the text messages to Word and then print them from your computer.

  • How do I print text message log?

    I want to print out a text message conversation that goes back pretty far, like three months. The forward option doesn't allow me to select all. That will take too long. I see there is an app called PhoneView, however it is $20. I have mobileme account... there has got to be another, less expensive, more time efficient way to do this?
    I have the iphone 3G (not the S).

    Phoneview is the only way I know of. It's a great app. If you want to do something outside of what apple offers then you have to pay for it. Having a MobileMe account has nothing to do with your text messages in your AT&T account.

  • Basic, basic question - how to order prints from more than one album at onc

    I am having two problems with iphoto - I would be most grateful for any help. First, when I go to upload my photos to a web-based printing company (like shutterfly or snapfish), and I click on the vendor's "browse" photos to find the album to upload, the way the photos come up does not correspond to my album titles in iphoto, so I can't find them. I have my photos sorted in labeled albums, and would like to upload them as such, but when I click on iphoto library, it brings up all kinds of other files that don't correspond to my current file labels. Can anyone help?
    Equally irritating, when I use apple's "order print" features, it only lets me order from one album at a time. I'd like to order from multiple albums all at once, without paying shipping for each one. Any ideas? Again, most grateful for any advice.

    Hi, Sestew, and welcome to Apple Discussions.
    Problem 1: Export the photos you want printed from iPhoto to a folder on the desktop. Use the printer's browser to navigate to that folder and upload them to the printing company from it. After uploading them, trash the folder that contains the exported copies. The pictures are still safe in your iPhoto library.
    Problem 2: Create a new album and place all the pictures you want printed in it. (A photo can appear in any number of albums, so doing this won't remove any of the pictures from the other albums they're already in.) Then order that album printed. Delete the album after ordering, if you wish — the pictures will remain in whatever other albums you've placed them in.

  • Simple Question: How to make a text subpicture highlight not appear by default?

    I'm sure I am missing some very easy one-button solution here, but here goes...
    I have a menu with just one single button on it. I have the 'Create Text Subpicture' box checked in the button properties panel. What I want is for the highlight to appear only when I roll over the button. But when I preview the menu, the button highlight is on automatically. It functions just fine. I just need to solve this one little highlight issue.
    Is it as easy as I am thinking it is?
    Thanks!
    bobby

    How do I assign rollover states? I've looked but can't find any reference to it.
    Thanks!
    bobby

Maybe you are looking for

  • ITunes has encountered a problem...

    Im having problems with my itunes, all of a sudden one day an error showed up saying "iTunes has encountered a problem and needs to close. We are sorry for the inconvenience." And then It asked me if I wanted to send error report or don't send. We ar

  • Is there a limit to the number of App pages like the iPhone?

    On the iPhone there is a limit to 11 pages of apps showing. (I know, I know... that's a lot). If you have more than that number of apps on the phone they won't display, you have to use searchlight to find them. Is that the same with the iPad? Does an

  • Which some field do not display

    the same field,some of it do not display the content also , when i use the function % total , the row of the function display,the col of it do not,why i confuse! can some one help me ! appreciate!

  • Constant disconnects and webpages failing to load ...

    First off I tried phoning but I just got passed around departments for 20+minutes and then hung up on... so naturally I don't care to go through that shoddy phone service again, I just hope theres a mod or something on here that can help. Basically m

  • Screen sharing useless now

    I'm running two Macs, both running Lion. Screen sharing via back to my mac had been working great and was very responsive a few weeks ago. One side of my connection is on a very fast broadband line at my work while the other connection is at my home