Giter Site home page Giter Site logo

silica's Introduction

Silica

Pure Swift CoreGraphics (or Quartz2D) implementation (Supports Linux)

silica's People

Contributors

colemancda avatar kevinvandenbreemen avatar kvandenbreemen avatar tomascw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silica's Issues

ambiguous use of 'nan'

Trying to build a package with Cacao (dependent on Silica), I'm hit with a fatal compile error complaining about an ambiguous use of 'nan'.
screenshot from 2017-10-12 14 01 13

How to contribute?

Hi. I forked this repository. I've added additional functionality that I needed. Also, I've updated dependencies repositories. So my question is: how I can contribute to this repository?
Also, is there a way to update dependencies?

Thanks in advance!

SillicaTests build issue

When trying to build a package that uses Sillica, there is this compile error:

error: the directory Sources/SilicaTests has an invalid name ('SilicaTests'): the name of a non-test module has a 'Tests' suffix

Cairo can't find cairo.h during build…

I'm using Silica in a swift package (vapor app). Cairo won't build… I've installed cairo etc via brew.

Any pointers much appreciated. I assume a header search paths issue of some kind?

New release with Linux build fix commit included

Hey, I'm new to swift. As far as I can see I can't use the master branch of packages with the package manager (which makes sense). So I get an error because commit aa4f82a is not included.

Can you make a 1.1.2 release of the package and the dependencies?

Thanks!

(Using the latest Swift release on Ubuntu 16.04)

Reference to CAIRO_HINT_METRICS_OFF when setting up FontOptions

Hello there,
In trying to build the latest version of the library on Ubuntu 18.04 I get an error when compiling CGFont. Error is

/my/path/to/Silica/Sources/Silica/CGFont.swift:52:35: error: cannot assign value of type '_cairo_hint_metrics' to type 'FontHintMetrics'
            options.hintMetrics = CAIRO_HINT_METRICS_OFF
                                  ^~~~~~~~~~~~~~~~~~~~~~

The specific part of the code is this in CGFont.swift, in the init() function:

...
let face = FontFace(fontConfigPattern: fontConfigPattern)

        let options = FontOptions()

        //  TODO    Does not compile...
        options.hintMetrics = CAIRO_HINT_METRICS_OFF

...

The definition of FontOptions appears to be found in cairo.h, specifically struct _cairo_cont_options. Actually setting the hint metrics for a FontOptions appears to be defined in cairo.h, here:

cairo_font_options_set_hint_metrics (cairo_font_options_t *options,
				     cairo_hint_metrics_t  hint_metrics);

The hint metrics type along with member CAIRO_HINT_METRICS_OFF, appears to be in the same file, here:

   typedef enum _cairo_hint_metrics {
       CAIRO_HINT_METRICS_DEFAULT,
       CAIRO_HINT_METRICS_OFF,
       CAIRO_HINT_METRICS_ON
   } cairo_hint_metrics_t;

If these definitions are all here and supported by the API then why should this error occur?

CGRect Already Provided Under Foundation Module in Swift Linux Releases?

Hello there,
I was trying to build the Cacao library and ran into an ambiguous reference error:

/path/to/my/checkout/Cacao/Sources/Cacao/UITableView.swift:966:12: error: ambiguous use of 'isNull'
        if rect.isNull == false, rect.size.height > 0 {
           ^
Foundation.CGRect:14:16: note: found this candidate
    public var isNull: Bool { get }
               ^
Silica.CGRect:15:16: note: found this candidate
    public var isNull: Bool { get }
               ^

It appears that CGRect is already available with Swift under Linux and does not need to be reimplemented. I've not had much luck finding anything in the Swift project's commit history indicating that this is a recent change. I did find an extension for CGRect in swift's stdlib allowing access to most of the fields/methods found in the Silica project's CGRect.swift file.

https://github.com/apple/swift/blob/6738a2afd7f8eae3a6f24740967ae5bbe08d7650/stdlib/public/SDK/CoreGraphics/CoreGraphics.swift

Removing the CGRect type from Silica allows the Cacao project to compile however.

I've forked Silica with this change and a few others here:
https://github.com/kevinvandenbreemen/Silica

Skia optional

Consider leave option to switch between skia or Cairo.
Skia much easy to build from sources for different platforms then Cairo.
For example If you would like to support android in any future.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.