summaryrefslogtreecommitdiff
path: root/Build/source/texk/makejvf
diff options
context:
space:
mode:
authorHironobu Yamashita <h.y.acetaminophen@gmail.com>2017-07-26 11:47:12 +0000
committerHironobu Yamashita <h.y.acetaminophen@gmail.com>2017-07-26 11:47:12 +0000
commit4012bd90fbd113c5ba63274dc31f2680e490bc9e (patch)
tree88b35693110d77a0fa1b67bd81d65414cce06d86 /Build/source/texk/makejvf
parenta75d11336415240ecda802ea24d26363487bea31 (diff)
makejvf/tfmread.c: more efficient code
git-svn-id: svn://tug.org/texlive/trunk@44893 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/makejvf')
-rw-r--r--Build/source/texk/makejvf/tfmread.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/Build/source/texk/makejvf/tfmread.c b/Build/source/texk/makejvf/tfmread.c
index 8059b1737e4..a2f3ac51288 100644
--- a/Build/source/texk/makejvf/tfmread.c
+++ b/Build/source/texk/makejvf/tfmread.c
@@ -11,7 +11,7 @@ unsigned char *header,*char_type,*char_info,*glue_kern;
int jfmread(int kcode)
{
- int i,ctype = 0,w_ind,w,ll,rr,gk_ind,k_ind,g_ind;
+ int i,ctype=0,w_ind,w,ll=0,rr=0,gk_ind,k_ind,g_ind;
for (i = 0 ; i < nt ; i++) {
if (upair(&char_type[i*4]) == kcode) {
@@ -25,46 +25,40 @@ int jfmread(int kcode)
w = width[w_ind];
rightamount = 0;
- if (w != zw) {
+ if (w != zw && ctype > 0) {
/* get natural length of JFM glue between <type0> and <type of kcode> */
gk_ind = char_info[0*4+3]; /* remainder for <type0> */
- ll = 0;
- if (ctype > 0) {
- for (i = 0 ; i < nl-gk_ind ; i++) {
- if (glue_kern[(gk_ind+i)*4+1] == ctype) {
- if (glue_kern[(gk_ind+i)*4+2] >= 128) {
- k_ind = glue_kern[(gk_ind+i)*4+3];
- ll = kern[k_ind];
- }
- else {
- g_ind = glue_kern[(gk_ind+i)*4+3];
- ll = glue[3*g_ind];
- }
- break;
+ for (i = 0 ; i < nl-gk_ind ; i++) {
+ if (glue_kern[(gk_ind+i)*4+1] == ctype) {
+ if (glue_kern[(gk_ind+i)*4+2] >= 128) {
+ k_ind = glue_kern[(gk_ind+i)*4+3];
+ ll = kern[k_ind];
}
- if (glue_kern[(gk_ind+i)*4] >= 128)
- break;
+ else {
+ g_ind = glue_kern[(gk_ind+i)*4+3];
+ ll = glue[3*g_ind];
+ }
+ break;
}
+ if (glue_kern[(gk_ind+i)*4] >= 128)
+ break;
}
/* get natural length of JFM glue between <type of kcode> and <type0> */
gk_ind = char_info[ctype*4+3]; /* remainder for <type of kcode> */
- rr = 0;
- if (ctype > 0) {
- for (i = 0 ; i < nl-gk_ind ; i++) {
- if (glue_kern[(gk_ind+i)*4+1] == 0) {
- if (glue_kern[(gk_ind+i)*4+2] >= 128) {
- k_ind = glue_kern[(gk_ind+i)*4+3];
- rr = kern[k_ind];
- }
- else {
- g_ind = glue_kern[(gk_ind+i)*4+3];
- rr = glue[3*g_ind];
- }
- break;
+ for (i = 0 ; i < nl-gk_ind ; i++) {
+ if (glue_kern[(gk_ind+i)*4+1] == 0) {
+ if (glue_kern[(gk_ind+i)*4+2] >= 128) {
+ k_ind = glue_kern[(gk_ind+i)*4+3];
+ rr = kern[k_ind];
+ }
+ else {
+ g_ind = glue_kern[(gk_ind+i)*4+3];
+ rr = glue[3*g_ind];
}
- if (glue_kern[(gk_ind+i)*4] >= 128)
- break;
+ break;
}
+ if (glue_kern[(gk_ind+i)*4] >= 128)
+ break;
}
if (abs(zw - ll - w - rr) <= 1) /* allow round-off error */
/* character width is truncated,