该字体已安装在我的计算机中。我还下载了字体,并提供了带有CSS的URL
public function send_notification_all(Request $request){
$this->validate($request, [
'title' => 'required|max:30|min:20',
'message' => 'required'
]);
$noti_title = $request->input('title');
$noti_body = $request->input('message');
$optionBuilder = new OptionsBuilder();
$optionBuilder->setTimeToLive(60*20);
$notificationBuilder = new PayloadNotificationBuilder($noti_title);
$notificationBuilder->setBody($noti_body)
->setSound('default');
$dataBuilder = new PayloadDataBuilder();
$dataBuilder->addData(['a_data' => 'my_data']);
$option = $optionBuilder->build();
$notification = $notificationBuilder->build();
$data = $dataBuilder->build();
$email = User::pluck('email')->toArray();
$downstreamResponse = FCM::sendTo($email, $option, $notification, $data);
$downstreamResponse->numberSuccess();
$downstreamResponse->numberFailure();
$downstreamResponse->numberModification();
if($downstreamResponse->numberSuccess() == 0 ){
return $this->errorResponse("unable to send notificaton to all",401);
}else {
return $this->successResponse(['msg' => 'message send successfully','successfull' => $downstreamResponse->numberSuccess(),'failures' => $downstreamResponse->numberFailure()]);
}
}
对于h1标签,它可以正常工作,但是当我尝试在画布上使用此字体时。然后它不起作用。
<style>
@font-face {
font-family: 'scripts';
src: url('SCRIPTBL.eot');
src: local('SCRIPTBL'), url('SCRIPTBL.woff') format('woff'), url('SCRIPTBL.ttf') format('truetype');
}
h1 {
font-family: 'scripts';
}
</style>
字体位置和URL非常合适。控制台没有显示任何有关此的错误。我尝试使用“ Arial”,“ Verdana”,“ Helvetica”等。它们正在工作,但“ scripts”->“ Script MT Bold”却无法工作。 这是一个代码库。 https://codepen.io/Dry_Ruffian/pen/KKPBmar 但是我无法在这支笔中插入字体。 谢谢。