# Implement \`all_font_families\` for the LinuxTextSystem \(\#8331\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a5eab29662e82458115841b10d1e7c7322644ba7)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a5eab29662e82458115841b10d1e7c7322644ba7

Requested commit: a5eab29662e82458115841b10d1e7c7322644ba7

Commit: a5eab29662e82458115841b10d1e7c7322644ba7

Tree: 7d7b2d7ad63bdaa9d36b99ada5d10a1ac6ccbe1b

Author: Maharshi Basu

Committer: GitHub

## Message

```
Implement `all_font_families` for the LinuxTextSystem (#8331)

Implemented the function to get all font family names for
`LinuxTextSystem` which was previously kept as `unimplemented`.

Release Notes:

- N/A

Change Explanation:

- We get the
[`&Database`](https://docs.rs/fontdb/0.16.1/fontdb/struct.Database.html)
struct from the
[`FontSystem`](https://docs.rs/cosmic-text/latest/cosmic_text/struct.FontSystem.html)
by using the `.db` method.
- From the `Database` struct we get the
[`FaceInfo`](https://docs.rs/fontdb/0.16.1/fontdb/struct.FaceInfo.html)
which the provides a method to get the family
names([`families`](https://docs.rs/fontdb/0.16.1/fontdb/struct.FaceInfo.html#structfield.families))
- The `families` function returns a tuple of Vec. The tuple consists of
the `String` containing the name and the
[`Language`](https://docs.rs/fontdb/0.16.1/fontdb/enum.Language.html)
struct.

*It is noted that for the `families` function, the first family is
always `English US` unless it is unavailable*

Since the empty function provided
[here](https://github.com/zed-industries/zed/blob/main/crates/gpui/src/platform/linux/text_system.rs#L75)
explicitly declares a `Vec<String>` as the return type so I am
prioritizing the `English US` font family unless advised otherwise by
the reviewer.

---------

Signed-off-by: Maharshi Basu <basumaharshi10@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
```

## Parents

- [6a6dbe3aa1e67cd0c52d56d46499b7462419f84e](https://git.cafe/gitcafe/zed/commit/6a6dbe3aa1e67cd0c52d56d46499b7462419f84e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a5eab29662e82458115841b10d1e7c7322644ba7?format=markdown)
