예제 #1
0
def collectFonts(searchName):
    # Bitcount is made from 3 spacing sets:
    #    - Monospaced (Grid, Mono)
    #    - Proportional (Prop)
    # Define the family name of fonts that we want to use,
    # including the type of spacing.

    # Just get paths of the fonts, not the Font objects.
    # We want quick interactive response.
    # Call imported method, to find all installed Bitcount fonts.
    fontNamePaths = getFamilyFontPaths(searchName)

    for fontName in fontNamePaths:
        if 'Prop' in fontName:
            print fontName

    if Use_BitPath:
        # Add Bitpath to selection pool of fonts
        if Spacing_Variant:
            familyName = 'BitpathMono'
        else:
            familyName = 'BitpathProp'

        bitpathPaths = getFamilyFontPaths(familyName)
        for fontName, fontPath in bitpathPaths.items(
        ):  # Merge the dictionaries
            fontNamePaths[fontName] = fontPath

    # Remove all italic or roman, depending on setting of [x] Italic checkbox.
    if not Italic:
        for fontName in fontNamePaths.keys():
            if 'Italic' in fontName:
                del fontNamePaths[fontName]
    elif Italic:
        for fontName in fontNamePaths.keys():
            if not 'Italic' in fontName:
                del fontNamePaths[fontName]  # Remove non-italic

    # Excluse Double if Condensed feature is selected
    if Condensed:
        for fontName in fontNamePaths.keys():
            if 'Double' in fontName:
                del fontNamePaths[fontName]

    # Filter types of usage
    for fontName, fontPath in fontNamePaths.items():
        if 'Bold' in fontName or 'Black' in fontName:
            boldPaths[fontName] = fontPath
            if 'Single' in fontName:
                singleBoldPaths[fontName] = fontPath
            else:
                doubleBoldPaths[fontName] = fontPath
        else:
            lightPaths[fontName] = fontPath
            if 'Single' in fontName:
                singleLightPaths[fontName] = fontPath
            else:
                doubleLightPaths[fontName] = fontPath
    return fontNamePaths
예제 #2
0
def collectFonts():
    # Bitcount is made from 3 spacing sets:
    #    - Monospaced (Grid, Mono)
    #    - Proportional (Prop)
    # Define the family name of fonts that we want to use,
    # including the type of spacing.
    if scriptGlobals.fontNamePaths:  # Already installed, skip.
        return

    if monoSpaced:
        familyName = 'BitcountMono'
    else:
        familyName = 'BitcountProp'  # Only works in layers, if also Single/Double is selected.

    # Just get paths of the fonts, not the Font objects.
    # We want quick interactive response.
    # Call imported method, to find all installed Bitcount fonts.
    scriptGlobals.fontNamePaths = getFamilyFontPaths(familyName)

    for fontName in scriptGlobals.fontNamePaths:
        if 'Prop' in fontName:
            print fontName

    if Use_BitPath:
        # Add Bitpath to selection pool of fonts
        if monoSpaced:
            familyName = 'BitpathMono'
        else:
            familyName = 'BitpathProp'

        bitpathPaths = getFamilyFontPaths(familyName)
        for fontName, fontPath in bitpathPaths.items(
        ):  # Merge the dictionaries
            scriptGlobals.fontNamePaths[fontName] = fontPath

    # Remove all italic or roman, depending on setting of [x] Italics checkbox.
    if not Italics:
        for fontName in scriptGlobals.fontNamePaths.keys():
            if 'Italic' in fontName:
                del scriptGlobals.fontNamePaths[fontName]
    elif Italics:
        for fontName in scriptGlobals.fontNamePaths.keys():
            if not 'Italic' in fontName:
                del scriptGlobals.fontNamePaths[fontName]  # Remove non-italics

    # Filter types of usage
    for fontName, fontPath in scriptGlobals.fontNamePaths.items():
        if 'Bold' in fontName or 'Black' in fontName:
            scriptGlobals.boldPaths[fontName] = fontPath
            if 'Single' in fontName:
                scriptGlobals.singleBoldPaths[fontName] = fontPath
            else:
                scriptGlobals.doubleBoldPaths[fontName] = fontPath
        else:
            scriptGlobals.lightPaths[fontName] = fontPath
            if 'Single' in fontName:
                scriptGlobals.singleLightPaths[fontName] = fontPath
            else:
                scriptGlobals.doubleLightPaths[fontName] = fontPath
예제 #3
0
frames = 16
fd = 0.4  # Frame duration

# Bitcount is made from 3 spacing sets:
#    - Monospaced (Grid, Mono)
#    - Proportional (Prop)
# Define the family name of fonts that we want to use,
# including the type of spacing.
if monoSpaced:
    familyName = 'BitcountMono'
else:
    familyName = 'BitcountProp'
# Just get paths of the fonts, not the Font objects.
# We want quick interactive response.
# Call imported method, to find all installed Bitcount fonts.
fontNamePaths = getFamilyFontPaths(familyName)
if not italics:
    for fontName in fontNamePaths.keys():
        if 'Italic' in fontName:
            del fontNamePaths[fontName]


# Define method to show a random sample
def drawSample(name, tt):
    fss1 = []
    fss2 = []
    for frame in range(frames):
        opacity = 0.8 + 0.2 * random()  # Not totally opaque.
        if color:
            c = choice(
                ((1, 1, 1, 1), (1, 1, 1, 1), (1, 1, 1, 1),
예제 #4
0
LC_Figures = True

MD_PATH = 'BitcountReference.md'
EXPORT_PATH = '_export/BitcountReference.pdf'

BOX_COLOR = (0.7, 0.7, 0.7)

MAIN_FLOW = 'main'  # ELement id of the text box on pages the hold the main text flow.

# Tracking presets
H1_TRACK = H2_TRACK = 10  # 1/1000 of fontSize, multiplier factor.
H3_TRACK = 0  # Tracking as relative factor to font size.
P_TRACK = 0

familyName = 'Bitcount'
BitcountPaths = getFamilyFontPaths(familyName)

BOOK = 'BitcountPropSingle-BookCircle'
MEDIUM = 'BitcountPropSingle-MediumCircle'
BOOK_ITALIC = 'BitcountPropSingle-BookCircleItalic'
BOLD = 'BitcountPropSingle-BoldCircleItalic'
BOLD = SEMIBOLD = 'BitcountPropSingle-BoldCircleItalic'

SEMIBOLD_CONDENSED = BOOK


# -----------------------------------------------------------------
def makeDocument():
    u"""Demo Bitcount Reference composer."""

    # Set some values of the default template (as already generated by the document).