Skip to content
TheChatArchiveThe Chat Archive
gpt-3.5-turbo-0613· OpenAIHugging Face Arena Human Preference 55K

I have a font named MyFont.ttf, why the css src: local(MyFont) doesn't work?

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Mistralmistral-medium’s answer.
  1. User

    I have a font named MyFont.ttf, why the css src: local(MyFont) doesn't work?

  2. Assistant

    The CSS src: local(MyFont) syntax is used to specify that a font should be loaded from the user's device or computer if it is available. However, there are a few reasons why it may not work:

    1. Font file not installed locally: If the font file (MyFont.ttf) is not installed on the user's device or computer, the local() syntax will not be able to find it.

    2. Incorrect font name: The font name specified in the local() syntax must match the font name as it is installed on the user's device or computer. Double-check that you are using the correct font name in the CSS.

    3. Different font formats: The local() syntax only works with locally installed fonts that have the same font format as specified in the CSS @font-face rule. For example, if you have used src: local(MyFont) in your CSS, the font file (MyFont.ttf) must be installed as a TrueType Font (TTF) on the user's device or computer.

    4. Limited browser support: The local() syntax may not be supported by all browsers. It is recommended to include fallback font formats in your @font-face rule, such as WOFF or WOFF2, to ensure compatibility across different browsers.

    If the src: local(MyFont) syntax is not working, you can consider using the src: url(MyFont.ttf) syntax to load the font file directly from a web server.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.