1 /* font-manager-font-preview.h 2 * 3 * Copyright (C) 2009 - 2021 Jerry Casiano 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. 17 * 18 * If not, see <http://www.gnu.org/licenses/gpl-3.0.txt>. 19 */ 20 21 #ifndef __FONT_MANAGER_FONT_PREVIEW_H__ 22 #define __FONT_MANAGER_FONT_PREVIEW_H__ 23 24 #include <glib.h> 25 #include <glib/gi18n-lib.h> 26 #include <glib-object.h> 27 #include <gdk/gdk.h> 28 #include <gtk/gtk.h> 29 #include <json-glib/json-glib.h> 30 #include <pango/pango-font.h> 31 32 #include "font-manager-font-scale.h" 33 #include "font-manager-preview-controls.h" 34 #include "font-manager-gtk-utils.h" 35 36 #define FONT_MANAGER_TYPE_FONT_PREVIEW (font_manager_font_preview_get_type()) 37 G_DECLARE_FINAL_TYPE(FontManagerFontPreview, font_manager_font_preview, FONT_MANAGER, FONT_PREVIEW, GtkBox); 38 39 40 /** 41 * FontManagerFontPreviewMode: 42 * @FONT_MANAGER_FONT_PREVIEW_MODE_PREVIEW: Interactive preview 43 * @FONT_MANAGER_FONT_PREVIEW_MODE_WATERFALL: Waterfall preview 44 * @FONT_MANAGER_FONT_PREVIEW_MODE_LOREM_IPSUM: Body text preview 45 */ 46 typedef enum 47 { 48 FONT_MANAGER_FONT_PREVIEW_MODE_PREVIEW, 49 FONT_MANAGER_FONT_PREVIEW_MODE_WATERFALL, 50 FONT_MANAGER_FONT_PREVIEW_MODE_LOREM_IPSUM 51 } 52 FontManagerFontPreviewMode; 53 54 GType font_manager_font_preview_mode_get_type (void); 55 #define FONT_MANAGER_TYPE_FONT_PREVIEW_MODE (font_manager_font_preview_mode_get_type()) 56 57 const gchar * font_manager_font_preview_mode_to_string (FontManagerFontPreviewMode mode); 58 const gchar * font_manager_font_preview_mode_to_translatable_string (FontManagerFontPreviewMode mode); 59 60 GtkWidget * font_manager_font_preview_new (void); 61 62 void font_manager_font_preview_set_preview_mode (FontManagerFontPreview *self, FontManagerFontPreviewMode mode); 63 void font_manager_font_preview_set_preview_size (FontManagerFontPreview *self, gdouble size_points); 64 void font_manager_font_preview_set_font_description (FontManagerFontPreview *self, const gchar *font); 65 void font_manager_font_preview_set_preview_text (FontManagerFontPreview *self, const gchar *preview_text); 66 void font_manager_font_preview_set_justification (FontManagerFontPreview *self, GtkJustification justification); 67 void font_manager_font_preview_set_sample_strings (FontManagerFontPreview *self, GHashTable *samples); 68 void font_manager_font_preview_set_max_waterfall_size (FontManagerFontPreview *self, gdouble size_points); 69 gdouble font_manager_font_preview_get_preview_size (FontManagerFontPreview *self); 70 gchar * font_manager_font_preview_get_font_description (FontManagerFontPreview *self); 71 gchar * font_manager_font_preview_get_preview_text (FontManagerFontPreview *self); 72 GtkJustification font_manager_font_preview_get_justification (FontManagerFontPreview *self); 73 FontManagerFontPreviewMode font_manager_font_preview_get_preview_mode (FontManagerFontPreview *self); 74 75 #endif /* __FONT_MANAGER_FONT_PREVIEW_H__ */ 76