Пример #1
0
 def get_kv():
     CoreLabel.register(
         name='NanumGothic',
         fn_regular='NanumGothic-Regular.ttf',
         fn_bold='NanumGothic-Bold.ttf',
     )
     # (name, fn_regular, fn_italic=None, fn_bold=None, fn_bolditalic=None)
     return '''
Пример #2
0
    def on_start(self):
        """ This is the start point of the kivy ui
        """
        win = Window
        win.bind(size=self.on_size, on_keyboard=self.on_keyboard)
        win.bind(on_key_down=self.on_key_down)

        # Register fonts without this you won't be able to use bold/italic...
        # inside markup.
        from kivy.core.text import Label

        Label.register(
            "Roboto",
            "data/fonts/Roboto.ttf",
            "data/fonts/Roboto.ttf",
            "data/fonts/Roboto-Bold.ttf",
            "data/fonts/Roboto-Bold.ttf",
        )

        if platform == "android":
            # bind to keyboard height so we can get the window contents to
            # behave the way we want when the keyboard appears.
            win.bind(keyboard_height=self.on_keyboard_height)

        self.on_size(win, win.size)
        config = self.electrum_config
        storage = WalletStorage(config.get_wallet_path())

        Logger.info("Electrum: Check for existing wallet")

        if storage.file_exists:
            wallet = Wallet(storage)
            action = wallet.get_action()
        else:
            action = "new"

        if action is not None:
            # start installation wizard
            Logger.debug("Electrum: Wallet not found. Launching install wizard")
            wizard = Factory.InstallWizard(config, self.network, storage)
            wizard.bind(on_wizard_complete=self.on_wizard_complete)
            wizard.run(action)
        else:
            wallet.start_threads(self.network)
            self.on_wizard_complete(None, wallet)

        self.on_resume()
Пример #3
0
    def on_start(self):
        ''' This is the start point of the kivy ui
        '''
        Logger.info("dpi: {} {}".format(metrics.dpi, metrics.dpi_rounded))
        win = Window
        win.bind(size=self.on_size,
                    on_keyboard=self.on_keyboard)
        win.bind(on_key_down=self.on_key_down)

        # Register fonts without this you won't be able to use bold/italic...
        # inside markup.
        from kivy.core.text import Label
        Label.register('Roboto',
                   'data/fonts/Roboto.ttf',
                   'data/fonts/Roboto.ttf',
                   'data/fonts/Roboto-Bold.ttf',
                   'data/fonts/Roboto-Bold.ttf')

        if platform == 'android':
            # bind to keyboard height so we can get the window contents to
            # behave the way we want when the keyboard appears.
            win.bind(keyboard_height=self.on_keyboard_height)

        self.on_size(win, win.size)
        config = self.electrum_config
        storage = WalletStorage(config.get_wallet_path())

        Logger.info('Electrum: Check for existing wallet')

        if storage.file_exists:
            wallet = Wallet(storage)
            action = wallet.get_action()
        else:
            action = 'new'

        if action is not None:
            # start installation wizard
            Logger.debug('Electrum: Wallet not found. Launching install wizard')
            wizard = Factory.InstallWizard(config, self.network, storage)
            wizard.bind(on_wizard_complete=self.on_wizard_complete)
            wizard.run(action)
        else:
            wallet.start_threads(self.network)
            self.on_wizard_complete(None, wallet)

        self.on_resume()
Пример #4
0
import os

from threading import Thread

from windowManager import hide_GUI, save_GUI_window_id

reload(sys)
sys.setdefaultencoding("utf-8")

# set font
from kivy.core.text import Label
try:
    os.chdir(os.path.dirname(__file__))
except Exception:
    pass
Label.register("DroidSans", "./Resources/fonts/DroidSansFallbackFull.ttf")

Builder.load_string('''
<Main>:
    pos: 0,0
    padding: 50
    rows: 6
    row_force_default: True
    row_default_height: 50
    spacing: 50
    orientation: 'vertical'

    canvas:
        Color:
            rgba: 0.368, 0.384, 0.447, 0.8
        Rectangle:
Пример #5
0
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.core.text import Label as CoreLabel
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.lang import Builder
from kivy import Config
__author__ = 'vahid'

CoreLabel.register(
    'FreeFarsi',
    'fonts/FreeFarsi.ttf',
    fn_bold='fonts/FreeFarsiBold.ttf'
)
#
# CoreLabel.register('Tahoma',
#                'fonts/tahoma.ttf',
#                fn_bold='fonts/tahoma-bold.ttf')


Config.set('graphics', 'width', '2096')
Config.set('graphics', 'height', '1424')


LOREM_EN = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras hendrerit purus ac ante suscipit, sit amet condimentum ex dapibus. In aliquam suscipit erat eget sodales. Phasellus sit amet nibh in neque viverra consectetur eget nec neque. Phasellus ut sem quis erat dictum pretium. Morbi ullamcorper leo nulla, et ultricies elit dictum nec. Proin eleifend ligula eget felis tempor efficitur. Duis ornare velit ante, sed tristique ipsum faucibus eu. Curabitur gravida ex pulvinar massa blandit fringilla. Nam eget sem aliquet, dictum urna quis, volutpat nibh. Morbi lobortis dolor viverra velit facilisis, eget tincidunt purus fermentum. Aliquam accumsan velit dui, a congue orci imperdiet non. Curabitur vehicula nisl nec fringilla tempus. Pellentesque ut faucibus risus. Suspendisse rutrum vel nunc ut commodo."

LOREM_FA = "لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از طراحان گرافیک است. چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی مورد نیاز و کاربردهای متنوع با هدف بهبود ابزارهای کاربردی می باشد. کتابهای زیادی در شصت و سه درصد گذشته، حال و آینده شناخت فراوان جامعه و متخصصان را می طلبد تا با نرم افزارها شناخت بیشتری را برای طراحان رایانه ای علی الخصوص طراحان خلاقی و فرهنگ پیشرو در زبان فارسی ایجاد کرد. در این صورت می توان امید داشت که تمام و دشواری موجود در ارائه راهکارها و شرایط سخت تایپ به پایان رسد وزمان مورد نیاز شامل حروفچینی دستاوردهای اصلی و جوابگوی سوالات پیوسته اهل دنیای موجود طراحی اساسا مورد استفاده قرار گیرد."


class RTLTextApp(App):
Пример #6
0
import os

from threading import Thread

from windowManager import hide_GUI, save_GUI_window_id

reload(sys)
sys.setdefaultencoding("utf-8")

# set font
from kivy.core.text import Label
try:
    os.chdir(os.path.dirname(__file__))
except Exception:
    pass
Label.register("DroidSans", "./Resources/fonts/DroidSansFallbackFull.ttf")

Builder.load_string('''
<Main>:
    pos: 0,0
    padding: 50
    rows: 6
    row_force_default: True
    row_default_height: 50
    spacing: 50
    orientation: 'vertical'

    canvas:
        Color:
            rgba: 0.368, 0.384, 0.447, 0.8
        Rectangle:
Пример #7
0
# Create our Resources
from kivy.resources import resource_add_path
resource_add_path('data/fonts')
resource_add_path('data/images/common')
resource_add_path('data/images/pdfmaker')
resource_add_path('data/images/cloud')
resource_add_path('data/images/student')
resource_add_path('Cloud')
resource_add_path('Cloud/pdfmaker')
resource_add_path('student_tools')

# register custom font
fn_regular = 'comic.ttf'
fn_bold = 'comicbd.ttf'
from kivy.core.text import Label as CoreLabel
CoreLabel.register('comic', fn_regular=fn_regular, fn_bold=fn_bold)

# our major imports
from Cloud.main import root

from kivy.storage.jsonstore import JsonStore
from kivy import platform
from kivy.clock import mainthread
from kivy.app import App

import os

if platform == 'android':
    from mahartstudios.android.api import set_status_color, remove_presplash
    from android.permissions import request_permissions
    remove_presplash()