2016-12-21 7 views
2

Wieldet用ShieldUIを使用してバーコードを生成しようとしています。ShieldUIバーコードText setFontSize

バーコードの場合、テキストも表示する必要があります。

テキストのサイズを設定しようとしていますが、出力がうまくいかず、バーコードがテキストサイズの設定をオーバーフローします。ここで

Barcode barcode = new Barcode(fieldName); 
BarcodeOptions options = barcode.getOptions(); 

options.setValue("123456"); 
options.setType(BarcodeOptions.Type.CODE_128); 
options.setHeight(30); 
options.setWidth(120); 

options.text.enabled=true; 
options.text.style.setFontSize("8"); //if I remove this, the barcode 
//shows ok, but the textsize is not the one that I desire 

item.add(barcode);      

はHTMLです:

<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:wicket="http://wicket.apache.org/" lang="en" xml:lang="en"> 
<head> 
<meta charset="utf-8" /> 
<link rel="stylesheet" type="text/css" 
    href="egp/css/shieldui-all.min.css" /> 
<script type="text/javascript" src="egp/js/jquery-1.10.2.min.js"></script> 
<script type="text/javascript" src="egp/js/shieldui-all.min.js"></script> 
<script type="text/javascript" src="egp/js/shieldui-barcode.min.js"></script> 
<wicket:head> 

</wicket:head> 
</head> 
<body> 
<table wicket:id="forEach"> 
      <tr> 
       <td> 
        <div 
         wicket:id="barcode"> 
        </div> 
       </td> 
      </tr> 
</table> 
</body> 
</html> 

これが結果です:

Click to see the image

答えて

1

私もその問題に気づいたとShieldUIに報告しています。彼らは修正をアップロードしました。 fontSizeをstringからintegerに変更することで問題は解決しました。おそらく最新のバージョンをダウンロードしてテストする必要があります。

関連する問題