gpt4 book ai didi

html - 使用自定义字体显示条形码

转载 作者:太空宇宙 更新时间:2023-11-04 14:05:25 25 4
gpt4 key购买 nike

我有将数字转换为条形码的字体。在我的 Win 7 机器上的 IE 11、FF 26 中,这对我来说并没有发生。请注意,此页面是 Intranet 应用程序的一部分,在 Windows 登录后。

CSS:

@font-face {
font-family: 'AdvC39b';
src: url('fonts/ADVC39B.TTF');
src: url('fonts/ADVC39B.TTF') format('truetype');
/*
font-weight: normal;
font-style: normal;
*/
}

.displayBarCode { font-family: AdvC39b; font-size: 16px; }

Html(删除了额外的内容):

<!DOCTYPE html>
<html>
<head id="Head2" runat="server">
<title></title>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<link href="Labels.css?v=1.0" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form2" runat="server">


<asp:DataGrid ID="hsGrid" runat="server" DataKeyField="HS_ID" AllowPaging="False" AutoGenerateColumns="False" Visible="False" BorderStyle="none" GridLines="none" ShowHeader="False" ShowFooter="false">
<ItemStyle HorizontalAlign="left"></ItemStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<div class="printContainerDiv">

<asp:Label ID="lblBarcodeEVID" CssClass="displayBarCode" runat="server" Text='<%# "*" + DataBinder.Eval(Container.DataItem, "evid") + "*" %>'></asp:Label>&nbsp;

</div>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>



</form>
</body>
</html>

附上图片.. enter image description here

最佳答案

你需要添加所有格式的字体 eot, ttf, woff, svg

尝试使用像 icomoon 这样的服务

编辑:

我使用这个 CSS 来声明自定义字体,它适用于所有浏览器

@font-face{
font-family: "Font Name";
src:url("fonts/font-name.eot?#iefix");
src:url("fonts/font-name.eot?#iefix") format("eot"),
url("fonts/font-name.woff") format("woff"),
url("fonts/font-name.ttf") format("truetype"),
url("fonts/font-name.svg") format("svg");
}

关于html - 使用自定义字体显示条形码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21167237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com