提交 ae4a9dd7 编写于 作者: W weixin_68179602

Fri Aug 4 19:04:15 CST 2023 inscode

上级 ef53fd87
{
}
\ No newline at end of file
......@@ -2,16 +2,45 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css" rel="stylesheet" type="text/css" />
<title>InsCode</title>
<title>PyScript Test</title>
<link rel="stylesheet" href="/static/pyscript/v2023.05.1/pyscript.css"/>
<script defer src="/static/pyscript/v2023.05.1/pyscript.js"></script>
</head>
<body>
<div class="container">
<img src="src/assets/logo.svg" alt="InsCode">
<div>欢迎来到 InsCode</div>
</div>
<script src="script.js"></script>
<py-config src="./py-config.toml"></py-config>
<py-repl id="py-repl" output="replOutput"></py-repl>
<div id="replOutput"></div>
<input type="file" id="uploadFile" accept="image/png">
<script>
let imgName;
const uploadFileInput = document.getElementById('uploadFile');
uploadFileInput.addEventListener('change', function() {
const files = uploadFileInput.files;
if (files.length > 0) {
imgName = files[0].name;
console.log(imgName);
}
/*
const file = uploadFileInput.files[0];
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function() {
const imagePath = reader.result;
console.log(imagePath);
// 在这里你可以将路径赋值给一个变量、显示到页面上等操作
};
*/
});
function runPython(){
run = pyscript.interpreter.globals.get("run");
run(imgName);
}
</script>
<!--<button py-click="run()">RUN</button>-->
<button onclick="runPython()">RUN</button>
<py-script src="./main.py"></py-script>
<py-terminal style="overflow: auto; max-height: 100px;"></py-terminal>
<div id="mpl"></div>
</body>
</html>
\ No newline at end of file
import math
import js
import numpy as np
from PIL import Image
def extract_image(image_path, count):
# 打开图片
img = Image.open(image_path)
# 获取图片的宽度和高度
width, height = img.size
w_h_radio = width / height
row_count = math.floor(count / w_h_radio)
column_count = (count-1) * 3 + 1
row_count = (row_count-1) * 3 + 1
cell_width = width // column_count
cell_height = height // row_count
# 存储挖取后的小图片
extracted_images = []
row_num = 0
col_num = 0
for row in range(row_count):
if row % 3 == 0:
row_images = []
for column in range(column_count):
if column % 3 == 0:
# 计算挖取的区域
left = column * cell_width
upper = row * cell_height
right = left + cell_width
lower = upper + cell_height
# 挖取图片并存储
extracted_image = np.array(img.crop((left, upper, right, lower)))
row_images.append(extracted_image)
col_num += 1
row_num += 1
# 将一行的小图片存储到二维数组中
extracted_images.append(row_images)
# 创建新的图片对象,用于重新组成图片
new_img = Image.new('RGB', (len(extracted_images[0]) * cell_width, len(extracted_images) * cell_height))
# 按照二维数组的顺序重新组成图片
for i, row_images in enumerate(extracted_images):
for j, extracted_image in enumerate(row_images):
row = i
column = j
# 计算放置的位置
left = column * cell_width
upper = row * cell_height
# 将小图片放置到新图片中
new_img.paste(Image.fromarray(extracted_image), (left, upper))
return new_img
def run(image_path):
print(image_path)
count = 30
new_image = extract_image(image_path, count)
display(new_image,target="mpl")
name = "imgExtract"
description = "description of PyScript"
version = ""
author_name = ""
packages = ["numpy","pillow"]
#plugins = []
[[fetch]]
from = './stars.png'
to_file = './stars.png'
[[interpreters]]
src="/static/pyodide/v0.21.3/pyodide.js"
name = "v0.21.3"
lang = "python"
\ No newline at end of file
<svg width="128" height="26" viewBox="0 0 128 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 13L6.92314 1L12.8629 4.42706L7.91706 13L12.8629 21.5729L6.92314 25L0 13ZM18.045 16.0707C18.7679 15.5876 19.6178 15.3298 20.4872 15.3298C21.6531 15.3298 22.7712 15.793 23.5956 16.6174C24.42 17.4417 24.8832 18.5599 24.8832 19.7257C24.8832 20.5952 24.6254 21.4451 24.1423 22.168C23.6593 22.8909 22.9727 23.4543 22.1695 23.787C21.3662 24.1198 20.4824 24.2068 19.6296 24.0372C18.7769 23.8676 17.9936 23.4489 17.3789 22.8341C16.7641 22.2193 16.3454 21.4361 16.1758 20.5833C16.0062 19.7306 16.0932 18.8467 16.4259 18.0435C16.7587 17.2402 17.3221 16.5537 18.045 16.0707ZM22.9295 10.0172C22.2066 10.5002 21.3567 10.7581 20.4872 10.7581C19.3214 10.7581 18.2033 10.2949 17.3789 9.47052C16.5545 8.64613 16.0913 7.52801 16.0913 6.36213C16.0913 5.4927 16.3491 4.6428 16.8322 3.91989C17.3152 3.19698 18.0017 2.63355 18.805 2.30083C19.6082 1.96812 20.4921 1.88106 21.3448 2.05068C22.1976 2.2203 22.9809 2.63897 23.5956 3.25375C24.2104 3.86853 24.6291 4.65181 24.7987 5.50453C24.9683 6.35726 24.8813 7.24113 24.5485 8.04438C24.2158 8.84763 23.6524 9.53418 22.9295 10.0172Z" fill="url(#paint0_linear_8_378)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.1992 3.8512H35.7463V22.14H40.1992V3.8512ZM107.788 8.14508H104.926C103.238 8.14508 101.62 8.81529 100.427 10.0083C99.2344 11.2012 98.5642 12.8193 98.5642 14.5064V15.7787C98.5635 16.6142 98.7275 17.4418 99.0469 18.2139C99.3664 18.986 99.8349 19.6876 100.426 20.2784C101.017 20.8693 101.718 21.3378 102.49 21.6572C103.262 21.9767 104.09 22.1407 104.926 22.14H111.764V3.8512H107.788V8.14508ZM103.997 17.9781C103.57 17.797 103.205 17.4963 102.946 17.1121C102.68 16.7183 102.538 16.2538 102.539 15.7787V14.5064C102.538 14.1876 102.602 13.872 102.726 13.5784C102.908 13.1457 103.214 12.7764 103.605 12.5171C103.997 12.2578 104.456 12.1199 104.926 12.1209H107.788V18.1641H104.926C104.607 18.1656 104.291 18.1023 103.997 17.9781ZM49.5026 8.14507C50.533 8.14431 51.5401 8.45229 52.3938 9.02929C53.0954 9.50216 53.67 10.1402 54.0671 10.8873C54.4642 11.6344 54.6717 12.4676 54.6712 13.3136V22.1399H50.6953V13.3136C50.6956 13.1931 50.6777 13.0733 50.6421 12.9582C50.6077 12.848 50.5573 12.7436 50.4926 12.6481C50.3627 12.4556 50.1799 12.3048 49.9662 12.2139C49.8196 12.1518 49.6618 12.1201 49.5026 12.1209H47.4352C47.3147 12.1206 47.1948 12.1386 47.0797 12.1742C46.9696 12.2085 46.8651 12.2589 46.7696 12.3237C46.5771 12.4535 46.4263 12.6363 46.3355 12.8501C46.2733 12.9967 46.2417 13.1544 46.2424 13.3136V22.1399H42.2666V13.3136C42.2659 12.6347 42.3991 11.9623 42.6585 11.3348C42.918 10.7074 43.2987 10.1374 43.7788 9.65727C44.2589 9.17718 44.829 8.79649 45.4564 8.53701C46.0838 8.27752 46.7562 8.14433 47.4352 8.14507H49.5026ZM66.2701 14.0762C65.5472 13.5791 64.6904 13.3131 63.8131 13.3136H60.3144C60.2219 13.3144 60.1303 13.2957 60.0456 13.2588C59.9473 13.215 59.8595 13.1507 59.7883 13.07C59.7171 12.9893 59.6641 12.8942 59.6329 12.7912C59.6097 12.7157 59.5982 12.6372 59.5987 12.5582C59.5981 12.4543 59.6181 12.3514 59.6576 12.2553C59.7133 12.1212 59.8067 12.006 59.9263 11.9237C59.9823 11.885 60.0436 11.8547 60.1084 11.8338C60.1751 11.813 60.2445 11.8025 60.3144 11.8028H63.177C63.4637 11.8017 63.7457 11.8755 63.9952 12.0167C64.2381 12.154 64.4433 12.3494 64.5923 12.5853L67.6871 10.6371C67.2077 9.87451 66.5427 9.24593 65.7544 8.81012C64.9661 8.37431 64.0801 8.14549 63.1793 8.14506H60.3168C59.7279 8.14474 59.1451 8.26433 58.604 8.49653C58.018 8.75033 57.494 9.12835 57.0684 9.60447C56.6428 10.0806 56.3257 10.6435 56.139 11.2542C55.8371 12.245 55.8888 13.31 56.2853 14.267C56.6119 15.0528 57.159 15.7271 57.8605 16.2088C58.5832 16.7058 59.4397 16.9717 60.3168 16.9714H63.8155C63.9076 16.9714 63.9987 16.9901 64.0834 17.0262C64.213 17.0835 64.3235 17.1768 64.4015 17.295C64.4424 17.3563 64.474 17.4233 64.4953 17.4938C64.5495 17.6699 64.5407 17.8593 64.4707 18.0297C64.4149 18.1639 64.3216 18.279 64.2019 18.3613C64.0885 18.4408 63.9532 18.483 63.8147 18.4822H60.3955C60.111 18.4831 59.831 18.4105 59.5828 18.2715C59.3408 18.1366 59.1361 17.9437 58.9872 17.7101L55.9068 19.6829C56.3887 20.4364 57.0526 21.0564 57.8372 21.4858C58.6218 21.9152 59.5019 22.1402 60.3963 22.1399H63.8155C64.4041 22.1404 64.9866 22.0208 65.5275 21.7885C66.3103 21.4519 66.9781 20.8946 67.4494 20.1846C68.0941 19.2159 68.3322 18.0325 68.1124 16.8898C67.8925 15.7471 67.2323 14.7365 66.2741 14.0762H66.2701ZM91.0906 8.14507C92.359 8.1432 93.5988 8.52185 94.6497 9.23206H94.6481C95.5119 9.81416 96.2193 10.5996 96.7082 11.5193C97.1971 12.439 97.4525 13.4648 97.4519 14.5064V15.7786C97.4519 17.4658 96.7817 19.0838 95.5887 20.2768C94.3957 21.4697 92.7777 22.14 91.0906 22.14H89.8183C88.9827 22.1407 88.1552 21.9766 87.3831 21.6572C86.611 21.3378 85.9094 20.8692 85.3186 20.2784C84.7277 19.6876 84.2592 18.986 83.9397 18.2139C83.6203 17.4418 83.4563 16.6142 83.457 15.7786V14.5064C83.457 12.8193 84.1272 11.2012 85.3202 10.0083C86.5132 8.81528 88.1312 8.14507 89.8183 8.14507H91.0906ZM93.2892 16.7066C93.413 16.4129 93.4766 16.0974 93.4761 15.7786V14.5072C93.4761 14.2664 93.4399 14.0271 93.3687 13.7971C93.3001 13.5759 93.1991 13.3661 93.0689 13.1745C92.8094 12.7903 92.4443 12.4894 92.0177 12.3078C91.7242 12.1835 91.4085 12.12 91.0898 12.1209H89.8175C89.3484 12.1202 88.8895 12.258 88.4985 12.5172C88.1075 12.7764 87.8018 13.1453 87.6197 13.5776C87.4954 13.8712 87.4318 14.1868 87.4328 14.5056V15.7778C87.4318 16.253 87.5734 16.7175 87.8392 17.1113C88.0985 17.4955 88.4637 17.7962 88.8904 17.9773C89.1836 18.1016 89.499 18.1651 89.8175 18.1641H91.0898C91.5646 18.1652 92.0288 18.0239 92.4225 17.7586C92.8067 17.4987 93.1077 17.1334 93.2892 16.7066ZM122.872 17.7101C122.723 17.9433 122.518 18.1361 122.277 18.2715C122.029 18.4103 121.749 18.4828 121.465 18.4822H119.079C118.74 18.4833 118.403 18.4157 118.09 18.2834C117.635 18.0896 117.246 17.7685 116.969 17.3586C116.887 17.236 116.815 17.1061 116.756 16.9706H126.876V14.3473C126.876 12.7024 126.223 11.1248 125.059 9.96167C123.896 8.79852 122.319 8.14506 120.674 8.14506H119.083C117.439 8.14506 115.861 8.79852 114.698 9.96167C113.535 11.1248 112.881 12.7024 112.881 14.3473V15.9377C112.88 16.7524 113.04 17.5593 113.352 18.3122C113.663 19.065 114.12 19.7491 114.696 20.3252C115.272 20.9013 115.956 21.3581 116.709 21.6695C117.462 21.9809 118.269 22.1408 119.083 22.1399H121.469C122.363 22.1399 123.243 21.9148 124.027 21.4854C124.811 21.056 125.475 20.4361 125.957 19.6829L122.872 17.7101ZM117.658 12.2362C118.078 11.9528 118.573 11.8019 119.079 11.8028H120.67C121.01 11.802 121.347 11.8699 121.661 12.0024C122.257 12.2536 122.734 12.7229 122.996 13.3144H116.754C116.949 12.8777 117.262 12.5042 117.659 12.2362H117.658ZM75.8225 7.98605C75.3634 7.98448 74.9144 8.12137 74.5343 8.37886C74.1652 8.63064 73.8764 8.98346 73.7026 9.39508C73.5825 9.67883 73.5211 9.98393 73.5221 10.292V15.6991C73.5208 16.1582 73.6577 16.607 73.9149 16.9873C74.1658 17.3591 74.519 17.6502 74.9319 17.8254C75.2157 17.9452 75.5208 18.0066 75.8288 18.0059H77.812C78.0118 18.0051 78.2107 17.9784 78.4036 17.9264C78.589 17.8776 78.7675 17.8055 78.9347 17.7117C79.2683 17.5247 79.5507 17.2584 79.757 16.9364L83.239 19.1629C82.6561 20.0735 81.8536 20.8228 80.9052 21.3419C79.9568 21.8611 78.8931 22.1333 77.812 22.1336H75.8241C74.1159 22.1336 72.4776 21.455 71.2697 20.2471C70.0618 19.0392 69.3832 17.401 69.3832 15.6928V10.292C69.3825 9.446 69.5486 8.60813 69.872 7.82636C70.1955 7.0446 70.6699 6.33427 71.2681 5.73604C71.8663 5.13781 72.5766 4.66341 73.3584 4.33999C74.1402 4.01657 74.978 3.85047 75.8241 3.8512H77.812C78.9039 3.84997 79.9782 4.1267 80.9336 4.65532C81.889 5.18395 82.6941 5.94708 83.2732 6.87282L79.7681 9.07066C79.6143 8.82592 79.4164 8.61184 79.1844 8.4393C78.7873 8.14395 78.3053 7.98496 77.8104 7.98605H75.8225Z" fill="#26294B"/>
<defs>
<linearGradient id="paint0_linear_8_378" x1="0" y1="1" x2="18.7137" y2="29.1027" gradientUnits="userSpaceOnUse">
<stop stop-color="#1FAEFF"/>
<stop offset="1" stop-color="#D86AE1"/>
</linearGradient>
</defs>
</svg>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="https://cdn.jsdelivr.net/npm/jquery"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.32.0/js/jquery.terminal.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/unix_formatting.min.js"></script>
<link
href="https://cdn.jsdelivr.net/npm/jquery.terminal@2.32.0/css/jquery.terminal.min.css"
rel="stylesheet"
/>
<script src="./pyodide.js"></script>
<style>
.terminal {
--size: 1.5;
--color: rgba(255, 255, 255, 0.8);
}
.noblink {
--animation: terminal-none;
}
body {
background-color: black;
}
#jquery-terminal-logo {
color: white;
border-color: white;
position: absolute;
top: 7px;
right: 18px;
z-index: 2;
}
#jquery-terminal-logo a {
color: gray;
text-decoration: none;
font-size: 0.7em;
}
#loading {
display: inline-block;
width: 50px;
height: 50px;
position: fixed;
top: 50%;
left: 50%;
border: 3px solid rgba(172, 237, 255, 0.5);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
-webkit-animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to {
-webkit-transform: rotate(360deg);
}
}
@-webkit-keyframes spin {
to {
-webkit-transform: rotate(360deg);
}
}
</style>
</head>
<body>
<div id="jquery-terminal-logo">
<a href="https://terminal.jcubic.pl/">jQuery Terminal</a>
</div>
<div id="loading"></div>
<script>
"use strict";
function sleep(s) {
return new Promise((resolve) => setTimeout(resolve, s));
}
async function main() {
let term;
globalThis.pyodide = await loadPyodide({
stdin: () => {
let result = prompt();
echo(result);
return result;
},
});
let namespace = pyodide.globals.get("dict")();
pyodide.runPython(
`
import sys
from pyodide.ffi import to_js
from pyodide.console import PyodideConsole, repr_shorten, BANNER
import __main__
BANNER = "Welcome to the Pyodide terminal emulator 🐍\\n" + BANNER
pyconsole = PyodideConsole(__main__.__dict__)
import builtins
async def await_fut(fut):
res = await fut
if res is not None:
builtins._ = res
return to_js([res], depth=1)
def clear_console():
pyconsole.buffer = []
`,
{ globals: namespace }
);
let repr_shorten = namespace.get("repr_shorten");
let banner = namespace.get("BANNER");
let await_fut = namespace.get("await_fut");
let pyconsole = namespace.get("pyconsole");
let clear_console = namespace.get("clear_console");
const echo = (msg, ...opts) =>
term.echo(
msg
.replaceAll("]]", "&rsqb;&rsqb;")
.replaceAll("[[", "&lsqb;&lsqb;"),
...opts
);
namespace.destroy();
let ps1 = ">>> ",
ps2 = "... ";
async function lock() {
let resolve;
let ready = term.ready;
term.ready = new Promise((res) => (resolve = res));
await ready;
return resolve;
}
async function interpreter(command) {
let unlock = await lock();
term.pause();
// multiline should be split (useful when pasting)
for (const c of command.split("\n")) {
let fut = pyconsole.push(c);
term.set_prompt(fut.syntax_check === "incomplete" ? ps2 : ps1);
switch (fut.syntax_check) {
case "syntax-error":
term.error(fut.formatted_error.trimEnd());
continue;
case "incomplete":
continue;
case "complete":
break;
default:
throw new Error(`Unexpected type ${ty}`);
}
// In JavaScript, await automatically also awaits any results of
// awaits, so if an async function returns a future, it will await
// the inner future too. This is not what we want so we
// temporarily put it into a list to protect it.
let wrapped = await_fut(fut);
// complete case, get result / error and print it.
try {
let [value] = await wrapped;
if (value !== undefined) {
echo(
repr_shorten.callKwargs(value, {
separator: "\n<long output truncated>\n",
})
);
}
if (pyodide.isPyProxy(value)) {
value.destroy();
}
} catch (e) {
if (e.constructor.name === "PythonError") {
const message = fut.formatted_error || e.message;
term.error(message.trimEnd());
} else {
throw e;
}
} finally {
fut.destroy();
wrapped.destroy();
}
}
term.resume();
await sleep(10);
unlock();
}
term = $("body").terminal(interpreter, {
greetings: banner,
prompt: ps1,
completionEscape: false,
completion: function (command, callback) {
callback(pyconsole.complete(command).toJs()[0]);
},
keymap: {
"CTRL+C": async function (event, original) {
clear_console();
term.enter();
echo("KeyboardInterrupt");
term.set_command("");
term.set_prompt(ps1);
},
TAB: (event, original) => {
const command = term.before_cursor();
// Disable completion for whitespaces.
if (command.trim() === "") {
term.insert("\t");
return false;
}
return original(event);
},
},
});
window.term = term;
pyconsole.stdout_callback = (s) => echo(s, { newline: false });
pyconsole.stderr_callback = (s) => {
term.error(s.trimEnd());
};
term.ready = Promise.resolve();
pyodide._api.on_fatal = async (e) => {
term.error(
"Pyodide has suffered a fatal error. Please report this to the Pyodide maintainers."
);
term.error("The cause of the fatal error was:");
term.error(e);
term.error("Look in the browser console for more details.");
await term.ready;
term.pause();
await sleep(15);
term.pause();
};
const searchParams = new URLSearchParams(window.location.search);
if (searchParams.has("noblink")) {
$(".cmd-cursor").addClass("noblink");
}
}
window.console_ready = main();
</script>
</body>
</html>
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
Arev Fonts Copyright
------------------------------
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.
$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
The STIX fonts distributed with matplotlib have been modified from
their canonical form. They have been converted from OTF to TTF format
using Fontforge and this script:
#!/usr/bin/env fontforge
i=1
while ( i<$argc )
Open($argv[i])
Generate($argv[i]:r + ".ttf")
i = i+1
endloop
The original STIX Font License begins below.
-----------------------------------------------------------
STIX Font License
24 May 2010
Copyright (c) 2001-2010 by the STI Pub Companies, consisting of the American
Institute of Physics, the American Chemical Society, the American Mathematical
Society, the American Physical Society, Elsevier, Inc., and The Institute of
Electrical and Electronic Engineers, Inc. (www.stixfonts.org), with Reserved
Font Name STIX Fonts, STIX Fonts (TM) is a trademark of The Institute of
Electrical and Electronics Engineers, Inc.
Portions copyright (c) 1998-2003 by MicroPress, Inc. (www.micropress-inc.com),
with Reserved Font Name TM Math. To obtain additional mathematical fonts, please
contact MicroPress, Inc., 68-30 Harrow Street, Forest Hills, NY 11375, USA,
Phone: (718) 575-1816.
Portions copyright (c) 1990 by Elsevier, Inc.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册