Comments (6)
I realized that Sparta doesn't align but only replaces tab character by 4 spaces (see Character>>#textRunOn:).
Rubric does align:
Code:
stringWithTabs := '
A A
AA A
AAA A
'.
RubEditingArea new
font: (LogicalFont familyName: 'Source Sans Pro' pointSize: 20);
updateTextWith: stringWithTabs;
tabWidth: 100;
openInWindow.
editor := AlbEditor new
text: stringWithTabs asRopedText;
yourself.
space := BlSpace new.
space root addChild: editor.
space show.
from alexandrie.
Debugging I see:
the editor has a current paragraph, then:
a paragraph has a RubTextComposer
--> a RubTextComposer
has a TextStyle
----> TextStyle
uses TextConstants
------> TextConstants
defines DefaultTabsArray
as #(24 48 72 96 120 144 168 ... 936 960)
and that's the default tab stops.
I wonder if our editor has equivalent text style and composer.
Pango seems to implement it similarly, you can just set a default tab width, or set an array of tab stops:
https://docs.gtk.org/Pango/struct.TabArray.html
btw, I've found interesting this elastic tabs, but didn't try it:
https://nickgravgaard.com/elastic-tabstops/
from alexandrie.
Do you think we can fix this more correctly like in Rubric? or it could be an easy workaround to do like Sparta, do a pass before rendering and convert each tab to certain number of spaces.
from alexandrie.
Character>>#textRunOn: ... :))
rrrrrrahhhh, shitty, could have seen it by myself
from alexandrie.
yes, Rubric handles tab a much clever way. I will think about that. it should be possible to change that.
Thanks, this is an Album issue now.
Regarding elastic tab: interesting, I will see how to allow such a feature in the futur
from alexandrie.
I will close this issue, as Alain fixed it.
text := stringWithTabs := '
A A
AA A
AAA A
' asRopedText.
text onAlbum openInOblSpace.
from alexandrie.
Related Issues (20)
- Text rendering produces segmentation fault on Pharo 12 HOT 2
- Move AeCanvas to Bloc-Alexandrie? HOT 2
- Mismatch in AeCairoSurface <-> Form round-trip conversion HOT 1
- Expose sourceColor: instead of sourceColorRGB: and sourceColorRGBA:
- Are AeCairoContext>>#appendPath: bench results justified?
- Support Cairo 1.18.0 ? HOT 8
- Two text tests randomly fail too often HOT 1
- Baseline: add group for no-tests HOT 2
- Crash on Hb example HOT 5
- Conversion from Cairo image to Form smells to be unnecessarily slow HOT 2
- AeCairoMatrix optimization: use new instead of externalNew
- Crash on Harbuzz example HOT 8
- 2 bindings error: MNU on tfPointerAddress HOT 1
- Fix the branches please HOT 1
- We now get FFIUnsupportedUntypedLiteral on P12 HOT 1
- AeFTFace did not understand #newCairoFontFace HOT 3
- Move embedded font faces away from FFI core package
- Create "Alexandrie-Cairo-Freetype" for cairo code that is only for freetype
- Make AeCanvasTest>>#renderForm independent of Pharo's big icon
- deadcode in renderBackgroundAlpha: backgroundAlpha hasBorder: hasBorder outskirtsSelector: outskirtsSelector HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alexandrie.