Skip to content

Commit bff94a2

Browse files
committed
initial commit
supports font name a loading
1 parent 17994eb commit bff94a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2908
-0
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[*.cs]
2+
indent_style = space
3+
indent_size = 4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ bld/
2121
[Bb]in/
2222
[Oo]bj/
2323
[Ll]og/
24+
artifacts/
2425

2526
# Visual Studio 2015 cache/options directory
2627
.vs/

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
# Fonts
22
Font loading and drawing library.
3+
4+
## Features
5+
- Reading font description (name, family, subname etc plus other string metadata)
6+
7+
## API Examples
8+
9+
### Read font description
10+
11+
```c#
12+
FontDescription description = null;
13+
using(var fs = File.OpenReader("Font.ttf")){
14+
description = FontDescription.Load(fs); // once it has loaded the data the stream is no longer required and can be disposed off
15+
}
16+
17+
string name = description.FontName;
18+
19+
```

SixLabors.Fonts.ruleset

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RuleSet Name="Shaper2D" ToolsVersion="14.0">
3+
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
4+
<Rule Id="SA1413" Action="None" />
5+
</Rules>
6+
</RuleSet>

SixLabors.Fonts.sln

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{C317F1B1-D75E-4C6D-83EB-80367343E0D7}"
7+
ProjectSection(SolutionItems) = preProject
8+
.editorconfig = .editorconfig
9+
global.json = global.json
10+
README.md = README.md
11+
EndProjectSection
12+
EndProject
13+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{815C0625-CD3D-440F-9F80-2D83856AB7AE}"
14+
EndProject
15+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{56801022-D71A-4FBE-BC5B-CBA08E2284EC}"
16+
EndProject
17+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{9E574A07-F879-4811-9C41-5CBDC6BAFDB7}"
18+
ProjectSection(SolutionItems) = preProject
19+
src\Shared\AssemblyInfo.Common.cs = src\Shared\AssemblyInfo.Common.cs
20+
EndProjectSection
21+
EndProject
22+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SixLabors.Fonts", "src\SixLabors.Fonts\SixLabors.Fonts.xproj", "{09E744EC-4852-4FC7-BE78-C1B399F17967}"
23+
EndProject
24+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SixLabors.Fonts.Tests", "tests\SixLabors.Fonts.Tests\SixLabors.Fonts.Tests.xproj", "{F836E8E6-B4D9-4208-8346-140C74678B91}"
25+
EndProject
26+
Global
27+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
28+
Debug|Any CPU = Debug|Any CPU
29+
Release|Any CPU = Release|Any CPU
30+
EndGlobalSection
31+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
32+
{09E744EC-4852-4FC7-BE78-C1B399F17967}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{09E744EC-4852-4FC7-BE78-C1B399F17967}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{09E744EC-4852-4FC7-BE78-C1B399F17967}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{09E744EC-4852-4FC7-BE78-C1B399F17967}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{F836E8E6-B4D9-4208-8346-140C74678B91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{F836E8E6-B4D9-4208-8346-140C74678B91}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{F836E8E6-B4D9-4208-8346-140C74678B91}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{F836E8E6-B4D9-4208-8346-140C74678B91}.Release|Any CPU.Build.0 = Release|Any CPU
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
GlobalSection(NestedProjects) = preSolution
45+
{9E574A07-F879-4811-9C41-5CBDC6BAFDB7} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
46+
{09E744EC-4852-4FC7-BE78-C1B399F17967} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
47+
{F836E8E6-B4D9-4208-8346-140C74678B91} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
48+
EndGlobalSection
49+
EndGlobal

SixLabors.Fonts.sln.DotSettings

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1200/@EntryIndexedValue">DO_NOT_SHOW</s:String>
3+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1201/@EntryIndexedValue">DO_NOT_SHOW</s:String>
4+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1401/@EntryIndexedValue">DO_NOT_SHOW</s:String>
5+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1600/@EntryIndexedValue">DO_NOT_SHOW</s:String>
6+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=StyleCop_002ESA1633/@EntryIndexedValue">DO_NOT_SHOW</s:String>
7+
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">False</s:Boolean></wpf:ResourceDictionary>

appveyor.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
version: 0.0.{build}
3+
install:
4+
- choco install gitversion.portable -pre -y
5+
6+
before_build:
7+
- ps: gitversion /l console /output buildserver
8+
9+
build_script:
10+
- cmd: build.cmd
11+
- cmd: tests\CodeCoverage\CodeCoverage.cmd
12+
13+
after_build:
14+
- cmd: appveyor PushArtifact "artifacts\SixLabors.Fonts.%GitVersion_NuGetVersion%.nupkg"
15+
16+
deploy:
17+
- provider: NuGet
18+
server: https://www.myget.org/F/sixlabors/api/v2/package
19+
symbol_server: https://www.myget.org/F/sixlabors/symbols/api/v2/package
20+
api_key:
21+
secure: SyrSERGrjkK21TSCsHtqke5279SMxXCg2NXKjR2qaErP0khEplwxPwE8Ch5bxzyf
22+
artifact: /.*\.nupkg/
23+
on:
24+
branch: master
25+
26+
test: off

build.cmd

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@echo Off
2+
3+
REM No glob support on Windows
4+
dotnet restore
5+
dotnet test ./tests/SixLabors.Fonts.Tests/ -c Release
6+
7+
if not "%errorlevel%"=="0" goto failure
8+
9+
REM run only if gitversion has ran i.e. from appveyor
10+
if not "%GitVersion_NuGetVersion%" == "" (
11+
cd src/SixLabors.Shapes
12+
ECHO Setting version number to "%GitVersion_NuGetVersion%"
13+
dotnet version "%GitVersion_NuGetVersion%"
14+
cd ../../
15+
if not "%errorlevel%"=="0" goto failure
16+
)
17+
18+
ECHO Building nuget packages
19+
if not "%GitVersion_NuGetVersion%" == "" (
20+
dotnet pack -c Release --output ./artifacts ./src/SixLabors.Fonts/project.json
21+
)ELSE (
22+
dotnet pack -c Release --version-suffix "local-build" --output ./artifacts ./src/SixLabors.Fonts/project.json
23+
)
24+
if not "%errorlevel%"=="0" goto failure
25+
26+
:success
27+
ECHO successfully built project
28+
REM exit 0
29+
goto end
30+
31+
:failure
32+
ECHO failed to build.
33+
REM exit -1
34+
goto end
35+
36+
:end

codecov.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: true
4+
comment:off
5+
coverage:
6+
precision: 2
7+
range:
8+
- 70.0
9+
- 100.0
10+
round: down
11+
status:
12+
changes: false
13+
patch: true
14+
project: true
15+
parsers:
16+
gcov:
17+
branch_detection:
18+
conditional: true
19+
loop: true
20+
macro: false
21+
method: false

gitversion.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# to create a new package you create a new release/tag
2+
# in github appveyor will build it without the -cixxx tag
3+
# it will then be deployable cleanly to nuget.org
4+
5+
branches:
6+
master:
7+
tag: ci
8+
mode: ContinuousDeployment
9+
increment: Minor
10+
prevent-increment-of-merged-branch-version: false
11+
track-merge-target: true
12+
ignore:
13+
sha: []

global.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"projects": [ "src" ],
3+
"sdk": {
4+
"version": "1.0.0-preview2-003121"
5+
}
6+
}

src/Shared/AssemblyInfo.Common.cs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// <copyright file="AssemblyInfo.Common.cs" company="Scott Williams">
2+
// Copyright (c) Scott Williams and contributors.
3+
// Licensed under the Apache License, Version 2.0.
4+
// </copyright>
5+
using System.Reflection;
6+
using System.Resources;
7+
using System.Runtime.CompilerServices;
8+
9+
// General Information about an assembly is controlled through the following
10+
// set of attributes. Change these attribute values to modify the information
11+
// associated with an assembly.
12+
[assembly: AssemblyDescription("A cross-platform library for processing of image files; written in C#")]
13+
[assembly: AssemblyConfiguration("")]
14+
[assembly: AssemblyCompany("Scott Williams")]
15+
[assembly: AssemblyProduct("SixLabors.Shapes")]
16+
[assembly: AssemblyCopyright("Copyright (c) Scott Williams and contributors.")]
17+
[assembly: AssemblyTrademark("")]
18+
[assembly: AssemblyCulture("")]
19+
[assembly: NeutralResourcesLanguage("en")]
20+
21+
// Version information for an assembly consists of the following four values:
22+
// Major Version
23+
// Minor Version
24+
// Build Number
25+
// Revision
26+
// You can specify all the values or you can default the Build and Revision Numbers
27+
// by using the '*' as shown below:
28+
// [assembly: AssemblyVersion("1.0.*")]
29+
[assembly: AssemblyVersion("1.0.0.0")]
30+
[assembly: AssemblyFileVersion("1.0.0.0")]
31+
[assembly: AssemblyInformationalVersion("1.0.0.0")]
32+
33+
// Ensure the internals can be tested.
34+
[assembly: InternalsVisibleTo("SixLabors.Fonts.Tests")]

src/Shared/stylecop.json

Whitespace-only changes.

0 commit comments

Comments
 (0)