PDF: fix width calculation of multi byte character in Simplified and Traditional Chinese (#61).
Contributed by Jun NAITOH. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5295 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+4
-4
@@ -210,7 +210,7 @@ module PDF_Chinese
|
|||||||
#Automatic line break
|
#Automatic line break
|
||||||
if(sep==-1 or i==j)
|
if(sep==-1 or i==j)
|
||||||
if(i==j)
|
if(i==j)
|
||||||
i+=ascii ? 1 : 3
|
i+=ascii ? 1 : 2
|
||||||
end
|
end
|
||||||
Cell(w,h,s[j,i-j],b,2,align,fill)
|
Cell(w,h,s[j,i-j],b,2,align,fill)
|
||||||
else
|
else
|
||||||
@@ -225,7 +225,7 @@ module PDF_Chinese
|
|||||||
b=b2
|
b=b2
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
i+=ascii ? 1 : 3
|
i+=ascii ? 1 : 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#Last chunk
|
#Last chunk
|
||||||
@@ -294,7 +294,7 @@ module PDF_Chinese
|
|||||||
next
|
next
|
||||||
end
|
end
|
||||||
if(i==j)
|
if(i==j)
|
||||||
i+=ascii ? 1 : 3
|
i+=ascii ? 1 : 2
|
||||||
end
|
end
|
||||||
Cell(w,h,s[j,i-j],0,2,'',0,link)
|
Cell(w,h,s[j,i-j],0,2,'',0,link)
|
||||||
else
|
else
|
||||||
@@ -311,7 +311,7 @@ module PDF_Chinese
|
|||||||
end
|
end
|
||||||
nl+=1
|
nl+=1
|
||||||
else
|
else
|
||||||
i+=ascii ? 1 : 3
|
i+=ascii ? 1 : 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#Last chunk
|
#Last chunk
|
||||||
|
|||||||
Reference in New Issue
Block a user