Commit ecc6c2cf authored by Manuel Quiñones's avatar Manuel Quiñones
Browse files

Use the sample string from Pango

This improves the internationalization, because each language
has a different pangram, to see the font applied in all the
alphabet characters.
parent 1b8f5ae2
......@@ -21,6 +21,7 @@ import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Handy', '1')
gi.require_version('WebKit2', '4.0')
gi.require_version('Pango', '1.0')
from gi.repository import Gtk, Gio, Handy
......@@ -16,7 +16,7 @@
# along with this program. If not, see <>.
#Import nescessary libraries and modules
#from gettext import gettext as _
from gi.repository import Gdk, Gio, Gtk, Handy, GObject, WebKit2
from gi.repository import Gdk, Gio, Gtk, Handy, GObject, WebKit2, Pango
from os import path, makedirs, listdir
import locale
import json
......@@ -30,6 +30,8 @@ locale.bindtextdomain('fontdownloader', path.join(path.dirname(__file__).split('
webfontsData = json.load(open(path.join(path.dirname(__file__).split('fontdownloader')[0],'fontdownloader/fontdownloader/webfonts.json'), 'r'))
SAMPLE_STRING = Pango.language_get_default().get_sample_string()
#Here we import the font-box template which is used for the fonts' boxes
class FontBox(Gtk.Box):
......@@ -125,7 +127,7 @@ class FontdownloaderWindow(Handy.Window):
#Creates temporary variables for our window
self.CurrentSelectedFont = ''
self.CurrentText = 'The quick brown fox jumps over the lazy dog.'
self.CurrentText = SAMPLE_STRING
self.CurrentFilters = {
'serif': self.serif_check.get_active(),
'sans-serif': self.sans_check.get_active(),
......@@ -365,7 +367,7 @@ class FontdownloaderWindow(Handy.Window):
#Get the text from the text entry
self.CurrentText = self.text_entry.get_text()
if self.CurrentText == "":
self.CurrentText = "The quick brown fox jumps over the lazy dog."
self.CurrentText = SAMPLE_STRING
#Creates a html file with everything (font and text, basically) :P
self.html ="""
<!DOCTYPE html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment