Closed sumy7 closed 8 years ago
You should have about 55 characters. Do you have a demo where this is happening, where I can try things out? Maybe jsfiddle?
I copy my code to jsfiddle. http://jsfiddle.net/sumy/f7qdrp1y/
You need to set the same font on .terminal because it's used for character calculation:
.terminal {
font-family: fantasquesansmono;
}
You will have 67 characters http://jsfiddle.net/f7qdrp1y/3/
Thanks a lot. I add the css, and clear browser cache, then it works.
Thanks for your suggestion. I try this method in my blog, but it didn't work. /(ㄒoㄒ)/~~
You notice that the problem is cause by font-family
, I want to say what I understand.
In the function char_size()
function, a fake terminal created calcualte the dimention of
representing one character. the normal <span>
width is 6, but my is 12.
font-family from jquery.terminal.css is
.terminal, .cmd {
font-family: FreeMono, monospace;
}
I don't have FreeMono and monospace in my computer. so a default font which have a big
would be selected.
My solution is using a higher priority selector to make my font-family be selected.
.terminal span{
font-family: fantasquesansmono !important;
}
monospace is meta name same as sans or sans-serif, browser will pick the font of that type.
Hello. I have try jquery.terminal today. It's cool. But I ran into a problem. I resize the term to 426px width, but only got 35 characters per line. It's the half of one line. I found that the number of characters relative to
num_rows
.I want to fill up the whole line. Is there any way or trick to solve this problem? sorry for my English.