问题:
我正在尝试使用Abadi MT Condensed Extra Bold字体。不幸的是,我找不到任何通过API提供此功能的CDN。我用来插入字体的css代码有什么问题吗?我知道样式表正在加载。
上下文
当我在系统的字体书中100%打开它时字体有效,但在禁用/删除时却没有 - 但我知道期望每个用户都有这种字体是不切实际的。因此,它在iPhone或Android设备上不起作用。
我最好在CDN中找到字体,或者是否可以使其工作?谢谢!
代码:
****** fonts.css ********
@font-face {
font-family: 'serif';
src: url('../fonts/Abadi MT Condensed Extra Bold.eot');
src: local('☺'), url('../fonts/Abadi MT Condensed Extra Bold.woff') format('woff'), url('../fonts/Abadi MT Condensed Extra Bold.ttf') format('truetype'), url('../fonts/Abadi MT Condensed Extra Bold.svg') format('svg');
font-weight: normal;
font-style: normal;
}
***** layout.pug *******
doctype html
html(lang='en')
head
meta(charset='utf-8')
meta(name='viewport', content='width=device-width, initial-scale=1, shrink-to-fit=no')
meta(name='description', content='')
meta(name='author', content='')
title #{title}
//jquery
script(src='https://code.jquery.com/jquery-2.2.4.min.js')
script(src='https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js')
//shopify
script(src='http://sdks.shopifycdn.com/js-buy-sdk/v0/latest/shopify-buy.umd.polyfilled.min.js')
//custom cart
script(src="scripts/cart.js")
//popper
script(src='./vendor/popper/popper.min.js')
//bootstrap
script(src='./vendor/bootstrap/js/bootstrap.min.js')
//Favicons
link(rel='apple-touch-icon', sizes='57x57', href='/favicon/apple-icon-57x57.png')
......
......
// Bootstrap core CSS
link(href='vendor/bootstrap/css/bootstrap.min.css', rel='stylesheet')
//Gliphicons had to be pulled in separately
link(href='//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css', rel='stylesheet')
// Custom fonts for this template
link(href='./stylesheets/fonts.css', rel='stylesheet')
// Custom styles for this template
link(href='./stylesheets/template.css', rel='stylesheet')
尝试解决方案
我已经尝试了像this这样的解决方案。此外,我的CSS代码过去没有整个fonts.css
文件。
答案 0 :(得分:0)
我能够解决这个问题,为其他任何有相同问题的人发帖。
我找到了this blob来帮助
所以现在我的最终代码是
$data = json_decode('{"request":{"phone_number":["0321553678","0321444"],"amount":["10","20"]}}');
$phoneNumbers = $data->request->phone_number;
$amount = $data->request->amount;
$map = array_combine($phoneNumbers, $amount);
foreach ($map as $phoneNumber => $amount) {
Transaction::create([
'amount' => $amount,
'phone_number' => $phoneNumber
]);
}