{extends file="config.tpl"}

{block name="content"}
    <form method="POST" action="{$modulelink}&amp;page=fonts" enctype='multipart/form-data' autocomplete="off">
        <div class="row">
            <div class="col-md-12">
                <h2><i class="fas fa-font"></i> Fonts</h2>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <h4 class="mb-3">Font embedding</h4>
                <div class="row">
                    <div class="form-group col-md-12">
                        <div class="radio">
                            <label>
                                <input type="radio" name="font_subsetting" value="0"{if $config.font_subsetting eq '0'} checked{/if}>
                                <strong>Embed full fonts</strong>
                                <br/>Improves performance but increases file size
                            </label>
                        </div>
                        <div class="radio">
                            <label>
                                <input type="radio" name="font_subsetting" value="1"{if $config.font_subsetting eq '1'} checked{/if}>
                                <strong>Embed font subsets</strong>
                                <br/>Decreases file size but slightly degrades performance
                                <br/><em>Note: not compatible with all fonts, might result in corrupted PDF files - Use with caution!</em>
                            </label>
                        </div>
                    </div>
                </div>
                <h4 class="mb-3">Font upload</h4>
                <div class="row">
                    <div class="form-group col-md-12">
                        <label for="fonts_upload">Upload fonts from your computer - multiple files supported</label>
                        <input type="file" class="form-control" name="fonts_upload[]" multiple/>
                        <div class="alert alert-info" role="alert">
                            <i class="fas fa-info-circle"></i>
                            Only TrueType fonts are supported
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <h4 class="mb-3">Font library</h4>
                <div class="row">
                    <div class="form-group col-md-6">
                        <label>Built-in fonts</label>
                        <ul class="list-group">
                            <li class="list-group-item">Courier</li>
                            <li class="list-group-item">Dejavu Sans</li>
                            <li class="list-group-item">FreeSans</li>
                            <li class="list-group-item">Helvetica</li>
                            <li class="list-group-item">Times</li>
                        </ul>
                    </div>
                    <div class="form-group col-md-6">
                        <label>Custom fonts</label>
                        <ul class="list-group">
                            {foreach $customfonts as $fontFile => $fontName}
                                <li class="list-group-item">{$fontName} <a href="{$modulelink}&amp;page=fonts&amp;delfont={$fontFile}"><i class="fas fa-trash-alt"></i></a></li>
                                {foreachelse}
                                <li class="list-group-item"><em>None</em></li>
                            {/foreach}
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-md-12">
                <hr class="mb-4">
            </div>
        </div>

        <div class="btn-group" role="group" aria-label="...">
            <button type="submit" class="btn btn-primary"><i class="fas fa-save"></i> Save</button>
        </div>

    </form>
{/block}
