Bolding in C++
Would anyone know how I would bold the first letter of a word in C++?
Thanks, J- |
sorry, that doesnt really make much sense, can you rephrase or say what your actually trying to do
|
I want to make the first letter of a word to be bold.
Ex: Help |
i understood your question, the fact is it doesnt make sense, c++ deals in plain text or binary, you would have to use an external graphics library to make it output anything like that.
if you can give me a clue as to what you want like "i want to input plain text and ouput html/TeX with the first letter of each word bolded" or "i want to open up a window that displays the contents of a text file with the first letter of each word in bold" then maybe i can help but just asking "how to bold the first letter of each word" makes no sense in this context. |
It is possible to bold characters using the ncurses library.
|
Like kev82 mentioned, you need to tell us what output format you're dealing with. Is it console, plain text (and other files), windows, html, etc?
|
It's a console application. Not sure if that helps...
Jessica |
why dont you use escape sequences for colour higlighting on terminals,
#include <iostream.h> int main () { cout<<"\033[01;37m"; cout<<"the bold text:\n"; cout<<"\033[0m"; return 0; } this program prints the line in white..emboldened... hope this has been of some help... here are some color codes you might like to use: black 0;30 green 0;32 red 0;31 brown 0;33 dark grey 1;31 light green 1;32 light red 1;31 yellow 1;33 blue 0;34 cyan 0;36 purple 0;35 light gray 0;37 light blue 1;34 light cyan 1;36 light purple 1;35 white 1;37 |
Awesome...thanks bunches.
Jessica |
It would be much better to implement this program using ncurses than escape sequences that may or may work with the given terminal. I will post a sample program when i get home.
|
yeah..agreed it would not work...atleast i dont think it would on VT100, but other than that ..it is working on the terminal that i use...ncurses doesnt sound like a great idea for such a small thing...
|
All times are GMT -5. The time now is 10:00 AM. |