This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run this with python3 | |
# See https://harmoniousapp.net/p/71/Set-Classes for more info | |
import math | |
# ------------------------ | |
# Utility functions for dealing with Set Classes | |
# a number in binary between 0 and 111111111111b (4093 decimal) can be converted | |
# to and from a list of integers, such as [0,4,7] which is 000010010001b or 145 decimal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
*/ | |
#import "RCTDeviceInfo.h" | |
#import <FBReactNativeSpec/FBReactNativeSpec.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { withoutXY } from '../lib/extract/extractProps'; | |
import Shape from './Shape'; | |
import { RNSVGPath } from './NativeComponents'; | |
export default class Path extends Shape<{ | |
d?: string; | |
}> { | |
static displayName = 'Path'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
* | |
* 2021-03-08 hacks by Jared Updike, to updateFont method. | |
* Allow picking width, optical size for complicated font families. For example I have a design using Merriweather | |
* with these font files: | |
Merriweather-12ptBold.ttf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ONLY CONVERTS TO .SVG FONTS | |
# REAME: call from ffconvert.sh with (cd /path/with/font/files && ffconvert.sh *.ttf) | |
# or *.otf | |
# if a problem occurs, just rename fonts without spaces! | |
echo "" | /Applications/FontForge.app/Contents/MacOS/FontForge -script /path/to/font-to-svg.txt $@ &>/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/Applications/FontForge.app/Contents/MacOS/FontForge | |
# ONLY CONVERTS TO .SVG FONTS | |
# REAME: call from ffconvert.sh with (cd /path/with/font/files && ffconvert.sh *.ttf) | |
# or *.otf | |
# if a problem occurs, just rename fonts without spaces! | |
#Open($1) | |
#Generate($1:r + ".svg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on the math here: | |
// http://math.stackexchange.com/a/1367732 | |
// x1,y1 is the center of the first circle, with radius r1 | |
// x2,y2 is the center of the second ricle, with radius r2 | |
function intersectTwoCircles(x1,y1,r1, x2,y2,r2) { | |
var centerdx = x1 - x2; | |
var centerdy = y1 - y2; | |
var R = Math.sqrt(centerdx * centerdx + centerdy * centerdy); | |
if (!(Math.abs(r1 - r2) <= R && R <= r1 + r2)) { // no intersection |