package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gtk/Ocgtk_gtk/Gtk/Wrappers/Font_chooser/index.html
Module Wrappers.Font_chooser
type t = [ `font_chooser ] Gobject.objval from_gobject : 'a Gobject.obj -> tval set_show_preview_entry : t -> bool -> unitShows or hides the editable preview entry.
val set_preview_text : t -> string -> unitSets the text displayed in the preview area.
The @text is used to show how the selected font looks.
val set_level : t -> Gtk_enums.fontchooserlevel -> unitSets the desired level of granularity for selecting fonts.
val set_language : t -> string -> unitSets the language to use for font features.
val set_font_map : t -> Ocgtk_pango.Pango.Wrappers.Font_map.t option -> unitSets a custom font map to use for this font chooser widget.
A custom font map can be used to present application-specific fonts instead of or in addition to the normal system fonts.
```c FcConfig *config; PangoFontMap *fontmap;
config = FcInitLoadConfigAndFonts (); FcConfigAppFontAddFile (config, my_app_font_file);
fontmap = pango_cairo_font_map_new_for_font_type (CAIRO_FONT_TYPE_FT); pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
gtk_font_chooser_set_font_map (font_chooser, fontmap); ```
Note that other GTK widgets will only be able to use the application-specific font if it is present in the font map they use:
```c context = gtk_widget_get_pango_context (label); pango_context_set_font_map (context, fontmap); ```
val set_font_desc : t -> Ocgtk_pango.Pango.Wrappers.Font_description.t -> unitSets the currently-selected font from @font_desc.
val set_font : t -> string -> unitSets the currently-selected font.
val get_show_preview_entry : t -> boolReturns whether the preview entry is shown or not.
val get_preview_text : t -> stringGets the text displayed in the preview area.
val get_level : t -> Gtk_enums.fontchooserlevelReturns the current level of granularity for selecting fonts.
val get_language : t -> stringGets the language that is used for font features.
val get_font_size : t -> intThe selected font size.
val get_font_map : t -> Ocgtk_pango.Pango.Wrappers.Font_map.t optionGets the custom font map of this font chooser widget, or %NULL if it does not have one.
val get_font_features : t -> stringGets the currently-selected font features.
The format of the returned string is compatible with the CSS font-feature-settings property(https://www.w3.org/TR/css-fonts-4/#font-rend-desc). It can be passed to func@Pango.AttrFontFeatures.new.
val get_font_family : t -> Ocgtk_pango.Pango.Wrappers.Font_family.t optionGets the `PangoFontFamily` representing the selected font family.
Font families are a collection of font faces.
If the selected font is not installed, returns %NULL.
val get_font_face : t -> Ocgtk_pango.Pango.Wrappers.Font_face.t optionGets the `PangoFontFace` representing the selected font group details (i.e. family, slant, weight, width, etc).
If the selected font is not installed, returns %NULL.
val get_font_desc : t -> Ocgtk_pango.Pango.Wrappers.Font_description.t optionGets the currently-selected font.
Note that this can be a different string than what you set with method@Gtk.FontChooser.set_font, as the font chooser widget may normalize font names and thus return a string with a different structure. For example, “Helvetica Italic Bold 12” could be normalized to “Helvetica Bold Italic 12”.
Use method@Pango.FontDescription.equal if you want to compare two font descriptions.
val get_font : t -> string optionGets the currently-selected font name.
Note that this can be a different string than what you set with method@Gtk.FontChooser.set_font, as the font chooser widget may normalize font names and thus return a string with a different structure. For example, “Helvetica Italic Bold 12” could be normalized to “Helvetica Bold Italic 12”.
Use method@Pango.FontDescription.equal if you want to compare two font descriptions.
val on_font_activated :
?after:bool ->
t ->
callback:(fontname:string -> unit) ->
Gobject.Signal.handler_id