You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+258Lines changed: 258 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,6 +266,264 @@ One easy solution is t modify `~/.gitconfig` and add
266
266
[](#questions)
267
267
268
268
269
+
[](#questions)
270
+
271
+
## Questions
272
+
273
+
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the [NativeScript Community Discord](https://nativescript.org/discord).
274
+
</details><details>
275
+
<summary><b>ui-canvaslabel</b></summary>
276
+
<!-- ⚠️ This README has been generated from the file(s) "blueprint.md" ⚠️-->
<b>Alternative to the built-in NativeScript Label but uses canvas which allows extreme complexity and customization.</b></br>
304
+
<sub><sub>
305
+
</p>
306
+
307
+
<br />
308
+
309
+
310
+
311
+
[](#table-of-contents)
312
+
313
+
314
+
[](#table-of-contents)
315
+
316
+
## Table of Contents
317
+
318
+
* [Installation](#installation)
319
+
* [Configuration](#configuration)
320
+
* [Performances](#performances)
321
+
* [TODO / Limitations](#todo--limitations)
322
+
* [Examples:](#examples)
323
+
* [Demos and Development](#demos-and-development)
324
+
* [Repo Setup](#repo-setup)
325
+
* [Build](#build)
326
+
* [Demos](#demos)
327
+
* [Contributing](#contributing)
328
+
* [Update repo ](#update-repo-)
329
+
* [Update readme ](#update-readme-)
330
+
* [Update doc ](#update-doc-)
331
+
* [Publish](#publish)
332
+
* [modifying submodules](#modifying-submodules)
333
+
* [Questions](#questions)
334
+
335
+
A NativeScript Label widget. This widget takes a different approch from other label components. It is based on `nativescript-canvas` and allows drawing
336
+
multiple labels within one single widget.
337
+
It allows extreme complexity and customization.
338
+
339
+
340
+
[](#installation)
341
+
342
+
343
+
[](#installation)
344
+
345
+
## Installation
346
+
Run the following command from the root of your project:
For full example / doc look at the vue demo and the typings.
394
+
395
+
396
+
[](#performances)
397
+
398
+
399
+
[](#performances)
400
+
401
+
## Performances
402
+
403
+
`CanvasLabel` is made to be real fast. It was designed principaly to be used within list views. It uses the technique of drawing the text directly instead of using heavy native text components.
404
+
That technique is used by many apps looking for the best performances. One of the best examples is Telegram.
405
+
406
+
407
+
[](#todo--limitations)
408
+
409
+
410
+
[](#todo--limitations)
411
+
412
+
## TODO / Limitations
413
+
414
+
* For now there is no accessibility support (but it should be possible)
415
+
* The label can't size itself. I will add some ways of doing that. But possibly not in the way you are used to.
416
+
* no ellipsize support yet. Will come ([this](https://github.com/lsjwzh/FastTextView/blob/5e440575539ab1f470d853b1e7462fe0251eb869/widget.FastTextView/src/main/java/android/text/EllipsisSpannedContainer.java) could be a solution)
417
+
* a lot of canvas features can be added like shadows, gradient ...
418
+
* transform supoort should be possible at least for groups and top spans.
419
+
420
+
### Examples:
421
+
422
+
- [Basic](demo-snippets/vue/CanvasLabel.vue)
423
+
- A basic SVG example
424
+
425
+
426
+
[](#demos-and-development)
427
+
428
+
429
+
[](#demos-and-development)
430
+
431
+
## Demos and Development
432
+
433
+
434
+
### Repo Setup
435
+
436
+
The repo uses submodules. If you did not clone with ` --recursive` then you need to call
437
+
```
438
+
git submodule update --init
439
+
```
440
+
441
+
The package manager used to install and link dependencies must be `pnpm` or `yarn`. `npm` wont work.
442
+
443
+
To develop and test:
444
+
if you use `yarn` then run `yarn`
445
+
if you use `pnpm` then run `pnpm i`
446
+
447
+
**Interactive Menu:**
448
+
449
+
To start the interactive menu, run `npm start` (or `yarn start` or `pnpm start`). This will list all of the commonly used scripts.
450
+
451
+
### Build
452
+
453
+
```bash
454
+
npm run build.all
455
+
```
456
+
WARNING: it seems `yarn build.all` wont always work (not finding binaries in `node_modules/.bin`) which is why the doc explicitly uses `npm run`
457
+
458
+
### Demos
459
+
460
+
```bash
461
+
npm run demo.[ng|react|svelte|vue].[ios|android]
462
+
463
+
npm run demo.svelte.ios # Example
464
+
```
465
+
466
+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in `demo-[ng|react|svelte|vue]`
467
+
Instead you work in `demo-snippets/[ng|react|svelte|vue]`
468
+
You can start from the `install.ts` of each flavor to see how to register new demos
469
+
470
+
471
+
[](#contributing)
472
+
473
+
474
+
[](#contributing)
475
+
476
+
## Contributing
477
+
478
+
### Update repo
479
+
480
+
You can update the repo files quite easily
481
+
482
+
First update the submodules
483
+
484
+
```bash
485
+
npm run update
486
+
```
487
+
488
+
Then commit the changes
489
+
Then update common files
490
+
491
+
```bash
492
+
npm run sync
493
+
```
494
+
Then you can run `yarn|pnpm`, commit changed files if any
495
+
496
+
### Update readme
497
+
```bash
498
+
npm run readme
499
+
```
500
+
501
+
### Update doc
502
+
```bash
503
+
npm run doc
504
+
```
505
+
506
+
### Publish
507
+
508
+
The publishing is completely handled by `lerna` (you can add `-- --bump major` to force a major release)
509
+
Simply run
510
+
```shell
511
+
npm run publish
512
+
```
513
+
514
+
### modifying submodules
515
+
516
+
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
517
+
One easy solution is t modify `~/.gitconfig` and add
0 commit comments