Text object font picker UI #71484

Open
opened 2019-11-11 03:38:45 +01:00 by Campbell Barton · 6 comments

Currently selecting a file to pick font's is not very convenient.

We can improve this by:

  • Automatically scanning the various system font folders, depending on the OS
  • Using auto-generated named previews, which are cached so we don't need to re-generate each time the menu opens
  • Presenting a single menu of fonts to the user

Example:
Screenshot 2019-11-11 at 15.40.42.png

Currently selecting a file to pick font's is not very convenient. We can improve this by: - Automatically scanning the various system font folders, depending on the OS - Using auto-generated named previews, which are cached so we don't need to re-generate each time the menu opens - Presenting a single menu of fonts to the user Example: ![Screenshot 2019-11-11 at 15.40.42.png](https://archive.blender.org/developer/F8027516/Screenshot_2019-11-11_at_15.40.42.png)
Author
Owner

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Added subscriber: @EAW

Added subscriber: @EAW

Added subscriber: @r-arvind

Added subscriber: @r-arvind

Hi, I would like to work on this task.

So essentially there are two ways to implement this:

  1. Make a list of the folders where system fonts are usually present in that specific OS. For example, in Linux, fonts are present in "/usr/share/fonts" or "/usr/local/share/fonts". We can scan those directories and get the list of font families. It has been implemented here in typescript. It can be used as reference.

  2. Use OS specific APIs for fetching the font information. For example, Linux comes with fontconfig, Mac has CoreText etc. We can use these APIs instead of manually scanning the folders. It has been implemented in C++ in this repo and can be used for reference.

Once we implement this, we can put it in a function called BKE_get_system_fonts in blender/blenderkernel/BKE_font.h. This function will return a struct (or an array of structs) containing the catalog of fonts-families.

Initially we can just print these values on to the terminal. Once everything works properly and integrates well with blender, we can expose these values in the property editor. Then we can implement additional features like font caching, font preview etc.

Hi, I would like to work on this task. So essentially there are two ways to implement this: 1. Make a list of the folders where system fonts are usually present in that specific OS. For example, in Linux, fonts are present in "/usr/share/fonts" or "/usr/local/share/fonts". We can scan those directories and get the list of font families. It has been implemented [here ](https://github.com/princjef/get-system-fonts) in typescript. It can be used as reference. 2. Use OS specific APIs for fetching the font information. For example, Linux comes with fontconfig, Mac has CoreText etc. We can use these APIs instead of manually scanning the folders. It has been implemented in C++ in this [repo ](https://github.com/foliojs/font-manager) and can be used for reference. Once we implement this, we can put it in a function called BKE_get_system_fonts in blender/blenderkernel/BKE_font.h. This function will return a struct (or an array of structs) containing the catalog of fonts-families. Initially we can just print these values on to the terminal. Once everything works properly and integrates well with blender, we can expose these values in the property editor. Then we can implement additional features like font caching, font preview etc.

Added subscriber: @tintwotin

Added subscriber: @tintwotin

If this is to be implemented, please consider also implementing it in the Video Editor Text Strips:
image.png

If this is to be implemented, please consider also implementing it in the Video Editor Text Strips: ![image.png](https://archive.blender.org/developer/F8779729/image.png)
Philipp Oeser removed the
Interest
Modeling
label 2023-02-09 15:29:34 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71484
No description provided.