> For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt.

# font-family

APISummary
## 介绍

font-family 允许你通过给定一个有先后顺序的，由字体名或者字体族名组成的列表来为选定的元件设置字体。

## 使用示例

**下面是一个示例: css-api**

**Entry:** `src/font-family`
**Bundle:** `dist/font-family.lynx.bundle`

```tsx
import { root } from "@lynx-js/react";
import "./index.scss";

const FontFamily = () => {
  const fontStyle = {
    fontFamily: "icon-font",
    fontSize: "20px",
  };

  return (
    <scroll-view className="root" scroll-orientation="vertical">
      <view style={{ flexDirection: "column" }} className="container">
        <text style={fontStyle}>
          {"base64编码的字体\n&#xe61c;&#xe61d;&#xe61e;&#xe61f;&#xe620;&#xe621;&#xe622;&#xe623;&#xe624;"}
        </text>
      </view>
    </scroll-view>
  );
};

root.render(<FontFamily />);

```

v0.11.0



## 语法

```css
font-family: font1, font2;
```

## 形式定义

| 初始值 |  |
| 适用元素 | text |
| 是否支持继承 | yes |
| 是否支持动画 | no |


## 形式语法

```
font-family =
  [ <string> | <custom-ident> ]#
```

## 兼容性

**Compatibility Table**

**Query:** `css.properties.font-family`

[Source](https://github.com/lynx-family/lynx/blob/develop/tools/css_generator/css_defines/61-font-family.json) · [MDN](https://developer.mozilla.org/zh-CN/docs/Web/CSS/font-family)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| font-family | Yes (1.0) | Yes (3.4) | Yes (1.0) | Yes (1.0) | Yes (1.0) | Yes |

**`font-family`**

**Specifications:**

