Skip to content

Commit

Permalink
Merge branch 'main' into working/morphing_ui
Browse files Browse the repository at this point in the history
  • Loading branch information
sabonerune committed Jan 14, 2023
2 parents bd2b4f1 + e61fcfa commit 97a59af
Show file tree
Hide file tree
Showing 70 changed files with 703 additions and 668 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ module.exports = {
ignoreRestSiblings: true,
},
],
"vue/component-tags-order": [
"error",
{
order: ["template", "script", "style"],
},
],
},
overrides: [
{
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
src/openapi/**/* linguist-generated=true
openapi.json linguist-generated=true
*.woff2 linguist-vendored=true
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ on:

env:
VOICEVOX_ENGINE_REPO_URL: "https://github.com/VOICEVOX/voicevox_engine"
VOICEVOX_ENGINE_VERSION: 0.13.3
VOICEVOX_RESOURCE_VERSION: 0.13.3
VOICEVOX_ENGINE_VERSION: 0.14.0-preview.8
VOICEVOX_RESOURCE_VERSION: 0.14.0-preview.0
VOICEVOX_EDITOR_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、999.999.999が入る
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999' }}
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
branches:
- '**'
- "**"
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -46,7 +46,21 @@ jobs:
restore-keys: |
${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-
- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: node_modules
key: ${{ env.cache-version }}-${{ runner.os }}--node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ env.cache-version }}-${{ runner.os }}--node-modules-
- run: npm ci
if: steps.cache-node-modules.outputs.cache-hit != 'true'

- name: Disallowed licenses check
run: npm run license:generate -- -o voicevox_licenses.json

- run: npm run typecheck
- run: npm run lint
- run: npm run markdownlint
Expand Down
47 changes: 35 additions & 12 deletions build/generateLicenses.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ const argv = yargs(hideBin(process.argv))
.option("output_path", {
alias: "o",
demandOption: true,
type: "string"
type: "string",
})
.help()
.parse();

const { execSync } = require("child_process");
const { execFileSync } = require("child_process");
const fs = require("fs");
const tmp = require("tmp");

const isWindows = process.platform === "win32";

const customFormat = {
name: "",
version: "",
Expand All @@ -24,29 +26,50 @@ const customFormat = {
copyright: "",
licenseFile: "none",
licenseText: "none",
licenseModified: "no"
licenseModified: "no",
};

const customFormatFile = tmp.fileSync();
fs.writeFileSync(customFormatFile.name, JSON.stringify(customFormat));

const disallowedLicenses = [
"GPL",
"GPL-2.0",
"GPL-3.0",
"AGPL",
"NGPL",
];

// On Windows, npm's global packages can be called with the extension `.cmd` or `.ps1`.
// On Linux (bash), they can be called without extensions.
const extension = isWindows ? ".cmd" : "";

// https://github.com/davglass/license-checker
// npm install -g license-checker
const licenseJson = execSync(
`license-checker --production --excludePrivatePackages --json --customPath ${customFormatFile.name}`,
const licenseJson = execFileSync(
`license-checker${extension}`,
[
"--production",
"--excludePrivatePackages",
"--json",
`--customPath=${customFormatFile.name}`,
`--failOn=${disallowedLicenses.join(";")}`,
],
{
encoding: "utf-8"
encoding: "utf-8",
}
);

const checkerLicenses = JSON.parse(licenseJson);

const licenses = Object.entries(checkerLicenses).map(([packageName, license]) => ({
name: license.name,
version: license.version,
license: license.licenses,
text: license.licenseText,
}));
const licenses = Object.entries(checkerLicenses).map(
([packageName, license]) => ({
name: license.name,
version: license.version,
license: license.licenses,
text: license.licenseText,
})
);

const outputPath = argv.output_path;
fs.writeFileSync(outputPath, JSON.stringify(licenses));
32 changes: 32 additions & 0 deletions docs/フォントについて.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# フォントの作り方

VOICEVOX では改変したRounded M+ 1pを使用しています。
具体的には、
- ヒント情報の削除
- ttfからwoff2への変換
を行っています。

## 手順

1. [自家製 Rounded M+ とは](http://jikasei.me/font/rounded-mplus/about.html)からRounded M+をダウンロードします。

2. [ttfautohint](https://freetype.org/ttfautohint/)をインストールします。
> **Note**
> [ttfautohint-py](https://pypi.org/project/ttfautohint-py/)を使用しました。
3. [woff2](https://github.com/google/woff2)をビルドします。

4. `rounded-mplus-20150529.7z`から`rounded-mplus-1p-(ウェイト).ttf`を全て`src/fonts`に解凍します。
5. ttfautohintを使用して、Rounded M+のヒント情報を削除します。名前は`Unhinted Rounded M+ 1p`とします。
6. woff2を使用して、ttfからwoff2へ変換します。

[#1103](https://github.com/VOICEVOX/voicevox/pull/1103)の作成には以下のスクリプトを使用しました(PowerShell 7.3.1)

```pwsh
# cwd:src/fonts
foreach ($f in gci("./*.ttf")){
py -m ttfautohint -dF " Unhinted" $f.name "unhinted-$($f.name)"
woff2_compress.exe "unhinted-$($f.name)"
}
```

8 changes: 7 additions & 1 deletion docs/細かい設計方針.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@

EngineId はエンジンが持つ ID で、世界で唯一かつ不変です。
SpeakerId は話者が持つ ID で、世界で唯一かつ不変。エンジン間でも同じ ID を持ちます。
StyleId はスタイルごとの ID で、話者ごとに唯一であれば良いです
StyleId はスタイルごとの ID で、エンジンごとに唯一であれば良いです

声を一意に決めるには、(EngineId, SpeakerId, StyleId)の3組が揃っている必要がある、という仕様を目指しています。
現状は、音声合成APIに SpeakerId 引数が無いため、(EngineId, StyleId)の2組で一意に声が決まっています。
現状は StyleId はエンジンごとに唯一である必要がありますが、話者ごとに唯一であれば良いという仕様を目指しています。

VOICEVOX は歴史的経緯により、 SpeakerId と StyleId が混同していることがあります。
特に型が整数値になっている SpeakerId は StyleId と混同している場合があります。
(エンジン API の SpeakerId 引数に StyleId を渡したりなど。)

StyleId は現在整数値型になっていますが、将来的にはUuidにしたいと考えています。

## シングルファイルコンポーネント(SFC、`.vue`ファイル)のtemplate、script、styleの順序

`<template>``<script>``<style>`の順序で記述してください。

2 changes: 1 addition & 1 deletion openapi.json

Large diffs are not rendered by default.

59 changes: 46 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@gtm-support/vue-gtm": "1.2.3",
"@quasar/extras": "1.10.10",
"ajv": "8.6.2",
"clone-deep": "4.0.1",
"core-js": "3.12.1",
"dayjs": "1.10.7",
"dotenv": "16.0.0",
Expand All @@ -54,12 +55,15 @@
"vue": "3.2.45",
"vue-router": "4.0.8",
"vuedraggable": "4.1.0",
"vuex": "4.0.2"
"vuex": "4.0.2",
"zod": "3.20.2",
"zod-to-json-schema": "3.20.1"
},
"devDependencies": {
"@openapitools/openapi-generator-cli": "2.3.3",
"@playwright/test": "1.23.3",
"@types/chai": "4.2.18",
"@types/clone-deep": "4.0.1",
"@types/electron-devtools-installer": "2.2.2",
"@types/encoding-japanese": "1.0.18",
"@types/glob": "8.0.0",
Expand Down
Loading

0 comments on commit 97a59af

Please sign in to comment.