| 1 |
/* font-manager-fsType.c |
| 2 |
* |
| 3 |
* Copyright (C) 2009-2022 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 |
#include "font-manager-fsType.h" |
| 22 |
|
| 23 |
/** |
| 24 |
* SECTION: font-manager-fsType |
| 25 |
* @short_description: fsType enum |
| 26 |
* @title: Font embedding restrictions |
| 27 |
* @include: font-manager-fsType.h |
| 28 |
* |
| 29 |
* The main purpose of this enumeration is to provide a description of the |
| 30 |
* fsType field of font files in a user friendly form. |
| 31 |
*/ |
| 32 |
|
| 33 |
GType |
| 34 |
font_manager_fsType_get_type (void) |
| 35 |
{ |
| 36 |
static gsize g_define_type_id__volatile = 0; |
| 37 |
|
| 38 |
if (g_once_init_enter (&g_define_type_id__volatile)) { |
| 39 |
static const GEnumValue values[] = { |
| 40 |
{ FONT_MANAGER_FSTYPE_INSTALLABLE, "FONT_MANAGER_FSTYPE_INSTALLABLE", "installable" }, |
| 41 |
{ FONT_MANAGER_FSTYPE_RESTRICTED_LICENSE, "FONT_MANAGER_FSTYPE_RESTRICTED_LICENSE", "restricted_license" }, |
| 42 |
{ FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT, "FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT", "preview_and_print" }, |
| 43 |
{ FONT_MANAGER_FSTYPE_EDITABLE, "FONT_MANAGER_FSTYPE_EDITABLE", "editable" }, |
| 44 |
{ FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_NO_SUBSET, "FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_NO_SUBSET", "preview_and_print_no_subset" }, |
| 45 |
{ FONT_MANAGER_FSTYPE_EDITABLE_NO_SUBSET, "FONT_MANAGER_FSTYPE_EDITABLE_NO_SUBSET", "editable_no_subset" }, |
| 46 |
{ FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_BITMAP_ONLY, "FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_BITMAP_ONLY", "preview_and_print_bitmap_only" }, |
| 47 |
{ FONT_MANAGER_FSTYPE_EDITABLE_BITMAP_ONLY, "FONT_MANAGER_FSTYPE_EDITABLE_BITMAP_ONLY", "editable_bitmap_only" }, |
| 48 |
{ FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_NO_SUBSET_BITMAP_ONLY, "FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_NO_SUBSET_BITMAP_ONLY", "preview_and_print_no_subset_bitmap_only" }, |
| 49 |
{ FONT_MANAGER_FSTYPE_EDITABLE_NO_SUBSET_BITMAP_ONLY, "FONT_MANAGER_FSTYPE_EDITABLE_NO_SUBSET_BITMAP_ONLY", "editable_no_subset_bitmap_only" }, |
| 50 |
{ 0, NULL, NULL } |
| 51 |
}; |
| 52 |
GType g_define_type_id = g_enum_register_static (g_intern_static_string ("FontManagerfsType"), values); |
| 53 |
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); |
| 54 |
} |
| 55 |
|
| 56 |
return g_define_type_id__volatile; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* font_manager_fsType_to_string: (skip) |
| 61 |
* @fstype: #FontManagerfsType |
| 62 |
* |
| 63 |
* Returns a description of the fsType field suitable for display. |
| 64 |
* |
| 65 |
* The least restrictive bit set is used. |
| 66 |
* Embedding-aware applications may interpret the fsType field differently. |
| 67 |
* |
| 68 |
* Returns: (transfer none) (nullable): @fstype as a string |
| 69 |
*/ |
| 70 |
const gchar * |
| 71 |
font_manager_fsType_to_string (gint fstype) { |
| 72 |
switch (fstype) { |
| 73 |
case FONT_MANAGER_FSTYPE_RESTRICTED_LICENSE: |
| 74 |
return _("Restricted License Embedding"); |
| 75 |
case FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT: |
| 76 |
return _("Preview & Print Embedding"); |
| 77 |
case FONT_MANAGER_FSTYPE_EDITABLE: |
| 78 |
return _("Editable Embedding"); |
| 79 |
case FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_NO_SUBSET: |
| 80 |
return _("Preview & Print Embedding | No Subsetting"); |
| 81 |
case FONT_MANAGER_FSTYPE_EDITABLE_NO_SUBSET: |
| 82 |
return _("Editable Embedding | No Subsetting"); |
| 83 |
case FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_BITMAP_ONLY: |
| 84 |
return _("Preview & Print Embedding | Bitmap Embedding Only"); |
| 85 |
case FONT_MANAGER_FSTYPE_EDITABLE_BITMAP_ONLY: |
| 86 |
return _("Editable Embedding | Bitmap Embedding Only"); |
| 87 |
case FONT_MANAGER_FSTYPE_PREVIEW_AND_PRINT_NO_SUBSET_BITMAP_ONLY: |
| 88 |
return _("Preview & Print Embedding | No Subsetting | Bitmap Embedding Only"); |
| 89 |
case FONT_MANAGER_FSTYPE_EDITABLE_NO_SUBSET_BITMAP_ONLY: |
| 90 |
return _("Editable Embedding | No Subsetting | Bitmap Embedding Only"); |
| 91 |
default: |
| 92 |
return _("Installable Embedding"); |
| 93 |
} |
| 94 |
} |
| 95 |
|