Rockbox Technical Forums
Rockbox Development => Starting Development and Compiling => Topic started by: Jazz00006 on October 08, 2006, 12:19:16 AM
-
I know it doesnt seem like this belongs here, but is there a way to do this using code? I have no idea how, (or if changing the encoding type changes anything)
would making a different font change anything?
thanks for any help or info
EDIT: Subject change
-
I think you should maybe clarify further what you're trying to do. I don't exactly know what you're asking.
-
well, some characters, such as É or ü, do not show up when viewing them through the viewer or a print function in code.
is there anyway to make ALL of them show, or is this not possible yet.
and as above, is this possible through code? or will i have to make my own font to make them show
-
They should show up as long as you're using a font that supports them. For example, have you tried Unifont?
-
Thanks, i will give it a try, i will post back with my results ^.^
-
i have tried using code
rb->lcd_setfont("Unifont");
or other similar ones, rb->lcd_setfont(Unifont); , rb->lcd_setfont(Font_Unifont);
but it gives me a small error, any ideas on this?
-
^^ dont worry about the above, new question
how would i write to a file, but with each write, make a new line? (I am only having trouble with the new line part)
In my file i have something similar to
fd = rb->open(Temp_Data,O_RDWR | O_CREAT);
while(rb->read_line(file,buffer1,100) != NULL)
{
char* pos = rb->strcasestr(buffer1,word);
if(pos != 0)
{
rb->fdprintf(fd, buffer1, sizeof(buffer1));
rb->yield();
}
}
rb->close(fd);
but with every time it does a search and write it only writes continusly, no gaps or spaces, only continous words.
Any help will be greatly apreciated, thankyou
-
fd = rb->open(Temp_Data,O_RDWR | O_CREAT);
while(rb->read_line(file,buffer1,100) != NULL)
{
char* pos = rb->strcasestr(buffer1,word);
if(pos != 0)
{
rb->fdprintf(fd, buffer1, sizeof(buffer1));
rb->yield();
}
}
rb->close(fd);
fdprintf prints a formatted text, so you need a formatter string. Why don't you use write instead?
rb->write(fd, buffer, sizeof(buffer));
should do it. You may also want to write only the amount of bytes read by read_line.
-
nope, that still gives me continous text,
heres a sample of what i get from it.
#!Translate Output File###Searching for: window ###==Begin File==# window: Fenster ühlen ) raße (f) ve] - igkeit ie Kühe nach Hause kommen ..) ] ichkeit[Noun] window: Fenster (n) n ) raße (f) ve] - igkeit ie Kühe nach Hause kommen ..) ] ichkeit[Noun] window glass: Fensterglas (n) (f) ve]
heres what i would like to see
#!Translate Output File#
#
#Searching for: window
#
#==Begin File==#
window: Fenster ühlen
window: Fenster (n)
window glass: Fensterglas (n) (f)
I understand some things are my fault, but the new line part isnt.
thanks for any help you wish to give
-
nope, that still gives me continous text,
heres a sample of what i get from it.
You are using read_line. From the comments of the read_line function (in apps/misc.c) you can find that all line ending characters are stripped. So you either need to read the lines a different way or add a line ending character after each line you wrote.
-
nope, that still gives me continous text,
heres a sample of what i get from it.
You are using read_line. From the comments of the read_line function (in apps/misc.c) you can find that all line ending characters are stripped. So you either need to read the lines a different way or add a line ending character after each line you wrote.
I think i understand what you mean, so...
how would i add a line ending char to each line i write then?
-
Use fdprintf() and add the newline to the format string:
rb->fdprintf(fd, "%s\n", buffer);