Merge pull request #38 from uobikiemukot/develop

merge develop into master
This commit is contained in:
uobikiemukot 2018-11-14 14:05:58 +09:00 committed by GitHub
commit e11b41bd28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 20675 additions and 59 deletions

View file

@ -438,7 +438,7 @@ void reset_mode(struct terminal_t *term, struct parm_t *parm)
set_cursor(term, 0, 0);
} else if (mode == 7) {
term->mode &= ~MODE_AMRIGHT;
term->wrap_occured = false;
term->wrap_occurred = false;
} else if (mode == 25) {
term->mode &= ~MODE_CURSOR;
} else if (mode == 8901) {

View file

@ -579,7 +579,7 @@ void decdld_parse_header(struct terminal_t *term, char *start_buf)
else if (erase_mode == 0) /* reset selected drcs charset */
memset(term->drcs + GLYPHS_PER_CHARSET * charset, 0, sizeof(struct glyph_t) * DRCS_CHARS);
//if (term->drcs[charset] == NULL) /* always allcate 96 chars buffer */
//if (term->drcs[charset] == NULL) /* always allocate 96 chars buffer */
//term->drcs[charset] = ecalloc(GLYPH_PER_CHARSET, sizeof(struct glyph_t));
decdld_parse_data(cp + 1, start_char, term->drcs + GLYPHS_PER_CHARSET * charset); /* skip final char */

View file

@ -411,7 +411,7 @@ static inline void draw_line(struct framebuffer_t *fb, struct terminal_t *term,
if (cellp->width == WIDE)
bdf_padding += CELL_WIDTH;
/* check cursor positon */
/* check cursor position */
if ((term->mode & MODE_CURSOR && line == term->cursor.y)
&& (col == term->cursor.x
|| (cellp->width == WIDE && (col + 1) == term->cursor.x)

View file

@ -1,39 +0,0 @@
《X Window BDF/PCF形式 16ドットフォントmilkjf》
製作 : 日本農園様
X68000/X68030 シリーズ用に日本農園様が製作されたmilkjfフォ
ント(全角非漢字部と半角)を,許可を得て X WindowのBDF形式に変換し
配布する事が可能になりました(Public Domainです).なお,オリジナル
の milkjfにない部分(特に漢字部)と, ギリシャ文字,ロシア文字は東
雲フォントを埋め込んでいます.
フォントの一覧は以下の通りですbold体はmkboldで作成したあと
若干フォントエディタで修正を加えたものです.
milkjf_8x16.bdf(.pcf)
-milkjf-fixed-medium-r-normal--16-150-75-75-C-80-iso8859-1
milkjf_8x16r.bdf(.pcf)
-milkjf-fixed-medium-r-normal--16-150-75-75-C-80-jisx0201.1976-0
milkjf_k16.bdf(.pcf)
-milkjf-fixed-medium-r-normal--16-150-75-75-C-160-jisx0208.1990-0
milkjf_8x16B.bdf(.pcf)
-milkjf-fixed-bold-r-normal--16-150-75-75-C-80-iso8859-1
milkjf_8x16rb.bdf(.pcf)
-milkjf-fixed-bold-r-normal--16-150-75-75-C-80-jisx0201.1976-0
milkjf_k16b.bdf(.pcf)
-milkjf-fixed-bold-r-normal--16-150-75-75-C-160-jisx0208.1990-0
X Window固有の問題等に関しては以下にて
http://phe.phyas.aichi-edu.ac.jp/~cyamauch/xfonts.html
cyamauch@hst.phyas.aichi-edu.ac.jp 山内千里 Oct.1,2001

39
fonts/milkjf/README.1ST Normal file
View file

@ -0,0 +1,39 @@
《X Window BDF/PCF形式 16ドットフォントmilkjf》
製作 : 日本農園様
X68000/X68030 シリーズ用に日本農園様が製作されたmilkjfフォ
ント(全角非漢字部と半角)を,許可を得て X WindowのBDF形式に変換し
配布する事が可能になりました(Public Domainです).なお,オリジナル
の milkjfにない部分(特に漢字部)と, ギリシャ文字,ロシア文字は東
雲フォントを埋め込んでいます.
フォントの一覧は以下の通りですbold体はmkboldで作成したあと
若干フォントエディタで修正を加えたものです.
milkjf_8x16.bdf(.pcf)
-milkjf-fixed-medium-r-normal--16-150-75-75-C-80-iso8859-1
milkjf_8x16r.bdf(.pcf)
-milkjf-fixed-medium-r-normal--16-150-75-75-C-80-jisx0201.1976-0
milkjf_k16.bdf(.pcf)
-milkjf-fixed-medium-r-normal--16-150-75-75-C-160-jisx0208.1990-0
milkjf_8x16B.bdf(.pcf)
-milkjf-fixed-bold-r-normal--16-150-75-75-C-80-iso8859-1
milkjf_8x16rb.bdf(.pcf)
-milkjf-fixed-bold-r-normal--16-150-75-75-C-80-jisx0201.1976-0
milkjf_k16b.bdf(.pcf)
-milkjf-fixed-bold-r-normal--16-150-75-75-C-160-jisx0208.1990-0
X Window固有の問題等に関しては以下にて
http://phe.phyas.aichi-edu.ac.jp/~cyamauch/xfonts.html
cyamauch@hst.phyas.aichi-edu.ac.jp 山内千里 Oct.1,2001

94
fonts/terminus/LICENSE Normal file
View file

@ -0,0 +1,94 @@
Copyright (c) 2014 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

20522
fonts/terminus/ter-u16n.bdf Normal file

File diff suppressed because it is too large Load diff

View file

@ -23,10 +23,10 @@ EFONT_URL=http://openlab.ring.gr.jp/efont/dist/unicode-bdf/${EFONT_FILE}
# already included in yaft
# unifont
UNIFONT_VERSION=8.0.01
UNIFONT_VERSION=11.0.02
UNIFONT_NAME=unifont-${UNIFONT_VERSION}
UNIFONT_FILE=${UNIFONT_NAME}.bdf.gz
UNIFONT_URL=http://unifoundry.com/pub/${UNIFONT_NAME}/font-builds/${UNIFONT_FILE}
UNIFONT_URL=http://unifoundry.com/pub/unifont/${UNIFONT_NAME}/font-builds/${UNIFONT_FILE}
# dina font (fetch from ProgrammingFonts repository)
DINA_VERSION=

View file

@ -31,7 +31,7 @@ glyph.h: mkfont_bdf
# ALIAS: glyph substitution rule file (see table/alias for more detail)
# BDF1 BDF2 BDF3...: monospace bdf files (must be the same size)
# If there is more than one glyph of the same codepoint, the glyph included in the first bdf file is choosed
./mkfont_bdf table/alias fonts/milkjf_k16.bdf fonts/milkjf_8x16r.bdf fonts/milkjf_8x16.bdf > glyph.h
./mkfont_bdf table/alias fonts/milkjf/milkjf_k16.bdf fonts/milkjf/milkjf_8x16r.bdf fonts/milkjf/milkjf_8x16.bdf fonts/terminus/ter-u16n.bdf > glyph.h
yaft: yaft.c $(HDR)
# If you want to change configuration, please modify conf.h before make (see conf.h for more detail)

View file

@ -130,7 +130,7 @@ void move_cursor(struct terminal_t *term, int y_offset, int x_offset)
x = 0;
} else if (x >= term->cols) {
if (term->mode & MODE_AMRIGHT)
term->wrap_occured = true;
term->wrap_occurred = true;
x = term->cols - 1;
}
term->cursor.x = x;
@ -167,7 +167,7 @@ void set_cursor(struct terminal_t *term, int y, int x)
term->cursor.x = x;
term->cursor.y = y;
term->wrap_occured = false;
term->wrap_occurred = false;
}
const struct glyph_t *drcs_glyph(struct terminal_t *term, uint32_t code)
@ -198,23 +198,23 @@ void addch(struct terminal_t *term, uint32_t code)
width = wcwidth(code);
if (width <= 0) /* zero width: not support comibining character */
if (width <= 0) /* zero width: not support combining characters */
return;
else if (0x100000 <= code && code <= 0x10FFFD) /* unicode private area: plane 16 (DRCSMMv1) */
glyphp = drcs_glyph(term, code);
else if (code >= UCS2_CHARS /* yaft support only UCS2 */
|| term->glyph[code] == NULL /* missing glyph */
|| term->glyph[code]->width != width) /* width unmatch */
|| term->glyph[code]->width != width) /* width unmatched */
glyphp = (width == 1) ? term->glyph[SUBSTITUTE_HALF]: term->glyph[SUBSTITUTE_WIDE];
else
glyphp = term->glyph[code];
if ((term->wrap_occured && term->cursor.x == term->cols - 1) /* folding */
if ((term->wrap_occurred && term->cursor.x == term->cols - 1) /* folding */
|| (glyphp->width == WIDE && term->cursor.x == term->cols - 1)) {
set_cursor(term, term->cursor.y, 0);
move_cursor(term, 1, 0);
}
term->wrap_occured = false;
term->wrap_occurred = false;
move_cursor(term, 0, set_cell(term, term->cursor.y, term->cursor.x, glyphp));
}
@ -293,7 +293,7 @@ void reset(struct terminal_t *term)
{
term->mode = MODE_RESET;
term->mode |= (MODE_CURSOR | MODE_AMRIGHT);
term->wrap_occured = false;
term->wrap_occurred = false;
term->scroll.top = 0;
term->scroll.bottom = term->lines - 1;

View file

@ -180,7 +180,7 @@ int main(int argc, char *argv[])
if (!map_glyph(font, glist_head, &default_glyph)) {
logging(FATAL, "map_glyph() failed\n");
goto err_occured;
goto err_occurred;
}
if (!load_alias(font, argv[1]))
@ -188,18 +188,18 @@ int main(int argc, char *argv[])
if (!check_font(font, &empty_half, &empty_wide)) {
logging(FATAL, "check_font() failed\n");
goto err_occured;
goto err_occurred;
}
if (!dump_font(font)) {
logging(FATAL, "dump_font() failed\n");
goto err_occured;
goto err_occurred;
}
cleanup(glist_head, &empty_half, &empty_wide);
return EXIT_SUCCESS;
err_occured:
err_occurred:
cleanup(glist_head, &empty_half, &empty_wide);
return EXIT_FAILURE;
}

4
x/x.h
View file

@ -195,7 +195,7 @@ static inline void draw_line(struct xwindow_t *xw, struct terminal_t *term, int
struct cell_t *cellp;
const struct glyph_t *glyphp;
/* at first, fill all pixels of line in backgournd color */
/* at first, fill all pixels of line in background color */
XSetForeground(xw->display, xw->gc, xw->color_palette[DEFAULT_BG]);
XFillRectangle(xw->display, xw->pixbuf, xw->gc, 0, line * CELL_HEIGHT, term->width, CELL_HEIGHT);
@ -219,7 +219,7 @@ static inline void draw_line(struct xwindow_t *xw, struct terminal_t *term, int
if (cellp->width == WIDE)
bdf_padding += CELL_WIDTH;
/* check cursor positon */
/* check cursor position */
if ((term->mode & MODE_CURSOR && line == term->cursor.y)
&& (col == term->cursor.x
|| (cellp->width == WIDE && (col + 1) == term->cursor.x)

2
yaft.h
View file

@ -156,7 +156,7 @@ struct terminal_t {
bool *line_dirty; /* dirty flag */
bool *tabstop; /* tabstop flag */
enum term_mode mode; /* for set/reset mode */
bool wrap_occured; /* whether auto wrap occured or not */
bool wrap_occurred; /* whether auto wrap occurred or not */
struct state_t state; /* for restore */
struct color_pair_t color_pair; /* color (fg, bg) */
enum char_attr attribute; /* bold, underscore, etc... */