git @ Cat's Eye Technologies Zplet / master
Merge pull request #3 from catseye/fix-word-wrap-for-font-size Fix word wrap for font size Alexander Mueller 6 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
109109 }
110110
111111 public ZScreen(String font_family, int font_size) {
112 Dimension mysize = getSize();
113
114112 this.setFixedFont(font_family, font_size);
115 fixedmetrics = getFontMetrics(fixedfont);
116 chars = mysize.width / fixedmetrics.charWidth(' ');
117 lines = mysize.height / fixedmetrics.getHeight();
118113
119114 inputcodes = new SyncVector();
120115 bufferedcodes = new Vector<Integer>();
355350 * the point size of the font (int).
356351 */
357352 public synchronized void setFixedFont(String font_family, int font_size) {
353 Dimension mysize = getSize();
358354 if (font_size <= 0)
359355 font_size = DEFAULT_FONT_SIZE;
360356 this.fixedfont = new Font(font_family, Font.PLAIN, font_size);
357 fixedmetrics = getFontMetrics(fixedfont);
358 chars = mysize.width / fixedmetrics.charWidth(' ');
359 lines = mysize.height / fixedmetrics.getHeight();
361360 }
362361
363362 /**