我在使用 yojo.ttf 字体时遇到问题。这是我的简单 html 代码
<html>
<head>
<style>
@font-face {
font-family: 'yojo';
src: url('./yojo.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
</style>
</head>
<body>
<p style="font-family: 'yojo'">?????</p>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
这种字体在Safari上运行良好,但在chrome和firefox上不起作用:段落中文本的字体不是yojo字体系列,控制台只显示警告信息:
无法解码下载的字体 OTS 解析错误:post: Failed to parse table
有没有办法在不修改字体文件的情况下解决问题?谢谢!
我有一个简单的maven项目与jpa和ejb,它运行在服务器glassfish 4.1上
我的persistence.xml文件是:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="EmployeeService" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>com.bkstorm.jpa.model.Employee</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/jpa" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="123456a@" />
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<!-- Configuring Connection Pool -->
<property name="hibernate.c3p0.min_size" value="5"/>
<property name="hibernate.c3p0.max_size" value="20"/>
<property name="hibernate.c3p0.timeout" value="500"/>
<property name="hibernate.c3p0.max_statements" value="50"/>
<property name="hibernate.c3p0.idle_test_period" value="2000"/>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
</properties>
</persistence-unit>
</persistence>Run Code Online (Sandbox Code Playgroud)
我的实体文件Employee.java:
@Entity
@Table(name = "employee")
public class Employee …Run Code Online (Sandbox Code Playgroud)我是Rxjava的新手.我有以下代码:
System.out.println("1: " + Thread.currentThread().getId());
Observable.create(new rx.Observable.OnSubscribe<String>() {
@Override
public void call(Subscriber<? super String> subcriber) {
System.out.println("2: " + Thread.currentThread().getId());
// query database
String result = ....
subcriber.onNext(result);
}
}).subscribeOn(Schedulers.newThread()).subscribe(countResult -> {
System.out.println("3: " + Thread.currentThread().getId());
});
Run Code Online (Sandbox Code Playgroud)
例如,输出将是:
1:50
2:100
3:100
我希望订阅者在ID为50的线程上运行.我该怎么做?