字体正在加载但未在Firefox上显示

时间:2019-12-12 02:51:26

标签: css font-face webfonts

我有这段代码来提供新的字体 (我正在使用symfony)

# Minimum CMake required
cmake_minimum_required(VERSION 2.8.12)

# Project
project(protobuf_enum_test)
set(CMAKE_CXX_STANDARD 11)

# Find required protobuf package
include(FindProtobuf)
find_package(protobuf REQUIRED)

if (protobuf_VERBOSE)
    message(STATUS "Using Protocol Buffers ${Protobuf_VERSION}")
endif ()

set(CMAKE_INCLUDE_CURRENT_DIR TRUE)


foreach (example write read)
    set(${example}_SRCS ${example}.cc)
    set(${example}_PROTOS test.proto)

    #Code Generation
    if (protobuf_MODULE_COMPATIBLE) #Legacy Support
        protobuf_generate_cpp(${example}_PROTO_SRCS ${example}_PROTO_HDRS ${${example}_PROTOS})
        list(APPEND ${example}_SRCS ${${example}_PROTO_SRCS} ${${example}_PROTO_HDRS})
    endif ()

    #Executable setup
    set(executable_name ${example})
    add_executable(${executable_name} ${${example}_SRCS} ${${example}_PROTOS})
    if (protobuf_MODULE_COMPATIBLE) #Legacy mode
        target_include_directories(${executable_name} PUBLIC ${PROTOBUF_INCLUDE_DIRS})
        target_link_libraries(${executable_name} ${PROTOBUF_LIBRARIES})
    else ()
        target_link_libraries(${executable_name} protobuf::libprotobuf)
        protobuf_generate(TARGET ${executable_name})
    endif ()

endforeach ()

在CSS中,我有

@font-face {
    font-family: "keplericon";
    src: url("{{ asset('fonts/keplericon/keplericon.eot')|raw }}") format("embedded-opentype"),
        url("{{ asset('fonts/keplericon/keplericon.woff2')|raw }}") format("woff2"),
        url("{{ asset('fonts/keplericon/keplericon.woff')|raw }}") format("woff"),
        url("{{ asset('fonts/keplericon/keplericon.svg')|raw }}") format("svg");
}

在Chrome浏览器中,这就像一个超级按钮。但它在Firefox中不起作用。我已通过转到.icon { font-family: keplericon } ->通过Network进行过滤来验证字体是否已下载,并查看我下载的文件(这是woff2文件)

但是什么都没有出现。检查HTML检查,显示

Weird box

任何帮助将不胜感激:D。谢谢!

0 个答案:

没有答案