Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Vincent Wei
mg-tools
Commits
d70b51ac
Commit
d70b51ac
authored
Apr 15, 2019
by
Vincent Wei
Browse files
cleanup
parent
2827e4db
Changes
58
Hide whitespace changes
Inline
Side-by-side
bdf2rbf/parse_bdf.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** parse_bdf.c: a bdf file parsor
**
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
**
** Author: WEI Yongming
**
...
...
common/bdf.h
View file @
d70b51ac
/*
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
** Author: WEI Yongming
** Create date: 2009/12/19
*/
...
...
common/gen_upf.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** gen_upf.c: a upf file generator
**
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
**
** Author: WEI Yongming
**
...
...
common/load_upf.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** load_upf.c: a upf loader
**
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
**
** Author: WEI Yongming
**
...
...
common/parse_bdf.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** parse_bdf.c: a bdf file parsor
**
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
**
** Author: WEI Yongming
**
...
...
common/qpf.h
View file @
d70b51ac
/*
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
** Author: WEI Yongming
** Create date: 2009/12/19
*/
...
...
common/types.h
View file @
d70b51ac
/*
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
** Author: WEI Yongming
** Create date: 2009/12/19
*/
...
...
common/upf.h
View file @
d70b51ac
/*
** Copyright (C) 2009 F
eynman Software
** Copyright (C) 2009 F
MSoft
** Author: WEI Yongming
** Create date: 2009/12/19
*/
...
...
common/vbf-3-0.h
View file @
d70b51ac
...
...
@@ -4,7 +4,7 @@
** varbitmap.h: the head file of raw bitmap font operation set.
**
** Copyright (C) 2000 ~ 2002, Wei Yongming.
** Copyright (C) 2003 ~ 2007 F
eynman Software
.
** Copyright (C) 2003 ~ 2007 F
MSoft
.
**
*/
...
...
dumpbmp/dumpbmp.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** vbfeditor.c: A VBF font editor.
**
** Copyright (C) 2003 F
eynman Software
.
** Copyright (C) 2003 F
MSoft
.
*/
/*
...
...
dumpbmp/dumpbmp.h
View file @
d70b51ac
/*
** Copyright (C) 2003, F
eynman Software
.
** Copyright (C) 2003, F
MSoft
.
*/
#ifndef _DUMPBMP_H
...
...
font-tools/qpf2upf.c
View file @
d70b51ac
...
...
@@ -4,7 +4,7 @@
** vi: tabstop=4:expandtab
**
**
** Copyright (C) 2005 ~ 2008, F
eynman Software
.
** Copyright (C) 2005 ~ 2008, F
MSoft
.
**
** Create date: 2008/01/26 mgwang
*/
...
...
font-tools/upf2c.c
View file @
d70b51ac
/*
** $Id: upf2c.c $
**
**
** vi: tabstop=4:expandtab
**
**
** Copyright (C) 2005 ~ 2008, F
eynman Software
.
** Copyright (C) 2005 ~ 2008, F
MSoft
.
**
** Create date: 2008/01/26
*/
...
...
@@ -17,7 +17,7 @@ typedef unsigned char Uint8;
typedef
char
Sint8
;
typedef
unsigned
int
Uint32
;
typedef
struct
typedef
struct
{
char
font_name
[
LEN_UNIDEVFONT_NAME
+
1
];
...
...
@@ -38,96 +38,100 @@ typedef struct
int
main
(
int
arg
,
char
*
argv
[])
{
FILE
*
tab
_file
=
NULL
;
FILE
*
c_file
=
NULL
;
unsigned
int
cha
;
unsigned
int
n
=
0
;
char
upf_cfile
[
128
],
name
[
256
]
=
{
0
};
char
*
s
;
if
(
arg
<
3
)
{
fprintf
(
stderr
,
"Usage: upf2c <upffile> <name>
[new_font_name]
\n
"
);
fprintf
(
stderr
,
"./upf2c unifont_160_50.upf unifont_160_50
\n
"
);
return
1
;
}
strcpy
(
name
,
"_
_mgif
_upf_"
);
FILE
*
font
_file
=
NULL
;
FILE
*
c_file
=
NULL
;
unsigned
int
cha
;
unsigned
int
n
=
0
;
char
upf_cfile
[
128
],
name
[
256
]
=
{
0
};
char
*
s
;
if
(
arg
<
3
)
{
fprintf
(
stderr
,
"Usage: upf2c <upffile> <name>
\n
"
);
fprintf
(
stderr
,
"./upf2c unifont_160_50.upf unifont_160_50
\n
"
);
return
1
;
}
strcpy
(
name
,
"_
incore_font
_upf_"
);
strcat
(
name
,
argv
[
2
]);
strcpy
(
upf_cfile
,
"upf_"
);
strcat
(
upf_cfile
,
argv
[
1
]);
s
=
strrchr
((
const
char
*
)
upf_cfile
,
'.'
);
if
(
s
==
NULL
)
{
printf
(
"Please specify the 'upf' file
\n
"
);
s
=
strrchr
((
const
char
*
)
argv
[
1
],
'.'
);
if
(
s
==
NULL
)
{
printf
(
"Please specify a 'upf' file
\n
"
);
return
1
;
}
*
s
=
'\0'
;
sprintf
(
s
,
"%s"
,
".c"
);
font_file
=
fopen
(
argv
[
1
],
"rb"
);
if
(
font_file
==
NULL
)
{
printf
(
"Cant open the font file: %s
\n
"
,
argv
[
1
]);
return
2
;
}
tab_file
=
fopen
(
argv
[
1
],
"rb"
);
strcpy
(
upf_cfile
,
argv
[
2
]);
strcat
(
upf_cfile
,
".c"
);
c_file
=
fopen
(
upf_cfile
,
"w"
);
if
(
c_file
==
NULL
)
{
printf
(
"Cant open the C file: %s
\n
"
,
upf_cfile
);
return
2
;
}
if
(
tab_file
==
NULL
)
{
printf
(
"Cant open the table file!
\n
"
);
return
2
;
}
c_file
=
fopen
(
upf_cfile
,
"w"
);
s
=
strrchr
((
const
char
*
)
upf_cfile
,
'.'
);
*
s
=
'\0'
;
fprintf
(
c_file
,
"/*
\n
"
);
fprintf
(
c_file
,
"** In-core UPF file for %s.
\n
"
,
name
);
fprintf
(
c_file
,
"**
\n
"
);
fprintf
(
c_file
,
"** This file is created by 'upf2c'
by FMSoft (http://www.fmsoft.cn).
\n
"
);
fprintf
(
c_file
,
"** This file is created by 'upf2c'
\n
"
);
fprintf
(
c_file
,
"** Please do not modify it manually.
\n
"
);
fprintf
(
c_file
,
"**
\n
"
);
fprintf
(
c_file
,
"** Copyright (C) 2009 Feynman Software
\n
"
);
fprintf
(
c_file
,
"**
\n
"
);
fprintf
(
c_file
,
"** All right reserved by Feynman Software.
\n
"
);
fprintf
(
c_file
,
"**
\n
"
);
fprintf
(
c_file
,
"*/
\n
"
);
fprintf
(
c_file
,
"#include <stdio.h>
\n
"
);
fprintf
(
c_file
,
"#include <stdlib.h>
\n
"
);
fprintf
(
c_file
,
"
\n
"
);
fprintf
(
c_file
,
"#include
\"
common.h
\"\n
"
);
fprintf
(
c_file
,
"#include
\"
minigui.h
\"\n
"
);
fprintf
(
c_file
,
"#include
\"
gdi.h
\"\n
"
);
fprintf
(
c_file
,
"#include <minigui/common.h>
\n
"
);
fprintf
(
c_file
,
"#include <minigui/minigui.h>
\n
"
);
fprintf
(
c_file
,
"#include <minigui/gdi.h>
\n
"
);
fprintf
(
c_file
,
"
\n
"
);
fprintf
(
c_file
,
"#ifdef _MGFONT_UPF
\n
"
);
fprintf
(
c_file
,
"
\n
"
);
fprintf
(
c_file
,
"#include
\"
upf.h
\"\n
"
);
fprintf
(
c_file
,
"typedef struct
\n
"
);
fprintf
(
c_file
,
"{
\n
"
);
fprintf
(
c_file
,
" Uint8 width;
\n
"
);
fprintf
(
c_file
,
" Uint8 height;
\n
"
);
fprintf
(
c_file
,
" Sint8 ascent;
\n
"
);
fprintf
(
c_file
,
" Sint8 descent;
\n
"
);
fprintf
(
c_file
,
" Uint8 max_width;
\n
"
);
fprintf
(
c_file
,
" Uint8 underline_pos;
\n
"
);
fprintf
(
c_file
,
" Uint8 underline_width;
\n
"
);
fprintf
(
c_file
,
" Sint8 leading;
\n
"
);
fprintf
(
c_file
,
" Uint8 mono_bitmap;
\n
"
);
fprintf
(
c_file
,
" Uint8 reserved[3];
\n
"
);
fprintf
(
c_file
,
" void* root_dir;
\n
"
);
fprintf
(
c_file
,
" Uint32 file_size;
\n
"
);
fprintf
(
c_file
,
"} UPFINFO;
\n
"
);
fprintf
(
c_file
,
"
\n
"
);
fprintf
(
c_file
,
"static unsigned char
%s[] = {
\n
"
,
upf_cfile
);
cha
=
0
;
while
(
1
)
{
if
(
fread
(
&
cha
,
1
,
1
,
tab
_file
)
!=
1
)
{
fprintf
(
c_file
,
"0x%02x"
,
0
);
break
;
}
fprintf
(
c_file
,
"0x%02x"
,
cha
);
fprintf
(
c_file
,
", "
);
if
(
++
n
%
10
==
0
)
fprintf
(
c_file
,
"
\n
"
);
cha
=
0
;
}
fprintf
(
c_file
,
"};
\n\n
"
);
fprintf
(
c_file
,
"UPFINFO %s = {
\n
"
,
name
);
fprintf
(
c_file
,
"static
const
unsigned char
font_data[] = {
\n
"
);
cha
=
0
;
while
(
1
)
{
if
(
fread
(
&
cha
,
1
,
1
,
font
_file
)
!=
1
)
{
fprintf
(
c_file
,
"0x%02x"
,
0
);
break
;
}
fprintf
(
c_file
,
"0x%02x"
,
cha
);
fprintf
(
c_file
,
", "
);
if
(
++
n
%
10
==
0
)
fprintf
(
c_file
,
"
\n
"
);
cha
=
0
;
}
fprintf
(
c_file
,
"};
\n\n
"
);
fprintf
(
c_file
,
"
const
UPFINFO %s = {
\n
"
,
name
);
fprintf
(
c_file
,
" 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0},
\n
"
);
fprintf
(
c_file
,
"
%s,
\n
sizeof (%s)
\n
"
,
upf_cfile
,
upf_cfile
);
fprintf
(
c_file
,
"
font_data, sizeof (font_data)
\n
"
);
fprintf
(
c_file
,
"};
\n\n
"
);
fprintf
(
c_file
,
"#endif /* _MGFONT_UPF */
\n
"
);
printf
(
"OK! translation is successful! there are %d bytes in the %s.c
\n
"
,
n
,
upf_cfile
);
fclose
(
tab
_file
);
fclose
(
c_file
);
return
0
;
printf
(
"OK! translation is successful! there are %d bytes in the %s.c
\n
"
,
n
,
upf_cfile
);
fclose
(
font
_file
);
fclose
(
c_file
);
return
0
;
}
font-tools/upfbbox.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** vi: tabstop=4:expandtab
**
** Copyright (C) 2009, F
eynman Software
.
** Copyright (C) 2009, F
MSoft
.
**
** Create date: 2009/12/01 WEI Yongming
*/
...
...
font-tools/upfdump.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** vi: tabstop=4:expandtab
**
** Copyright (C) 2009, F
eynman Software
.
** Copyright (C) 2009, F
MSoft
.
**
** Create date: 2009/12/09 WEI Yongming
*/
...
...
font-tools/upfmerge.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** vi: tabstop=4:expandtab
**
** Copyright (C) 2005 ~ 2009, F
eynman Software
.
** Copyright (C) 2005 ~ 2009, F
MSoft
.
**
** Create date: 2008/08/25 hejian
*/
...
...
font-tools/upfmetrics.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** vi: tabstop=4:expandtab
**
** Copyright (C) 2009, F
eynman Software
.
** Copyright (C) 2009, F
MSoft
.
**
** Create date: 2009/12/09 WEI Yongming
*/
...
...
font-tools/vbf2c.c
View file @
d70b51ac
...
...
@@ -5,7 +5,7 @@
**
** vbf2c.c: Dump VBF font to in-core C file.
**
** Copyright (C) 2007, F
eynman Software
.
** Copyright (C) 2007, F
MSoft
.
**
** Create date: 2007/04/24
*/
...
...
@@ -597,9 +597,9 @@ static void dumpVBF2C (const char* name, const VBFINFO* vbf_info, int len_bits)
printf
(
"** This file is created by 'vbf2c' by FMSoft (http://www.fmsoft.cn).
\n
"
);
printf
(
"** Please do not modify it manually.
\n
"
);
printf
(
"**
\n
"
);
printf
(
"** Copyright (C) 2007 F
eynman Software
\n
"
);
printf
(
"** Copyright (C) 2007 F
MSoft
\n
"
);
printf
(
"**
\n
"
);
printf
(
"** All right reserved by F
eynman Software
.
\n
"
);
printf
(
"** All right reserved by F
MSoft
.
\n
"
);
printf
(
"**
\n
"
);
printf
(
"*/
\n
"
);
...
...
image-dumper/dumpbmp.c
View file @
d70b51ac
...
...
@@ -3,7 +3,7 @@
**
** vbfeditor.c: A VBF font editor.
**
** Copyright (C) 2003 F
eynman Software
.
** Copyright (C) 2003 F
MSoft
.
*/
/*
...
...
image-dumper/dumpbmp.h
View file @
d70b51ac
/*
** Copyright (C) 2003, F
eynman Software
.
** Copyright (C) 2003, F
MSoft
.
*/
#ifndef _DUMPBMP_H
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment