Unicode框图对角线

7
我有一个表格,使用ascii中的斜线来绘制。基本上是/\^V<>的混合体,像这样:
  ^
 / \
<   >
 \ /
  v

我更倾向于使用适合此工作的Unicode字符,如,但我缺少^V<>的字符,因此我只能这样做:

  ╳
 ╱ ╲
╳   ╳
 ╲ ╱
  ╳

这些字符似乎无法表达我想要传达的内容。

我想知道是否有一些盒子绘制字符我还不知道?

基本上,我参考了这个块,但可能还有其他块具有更适合绘制对角线的字符。 我还查看了http://shapecatcher.com/,它建议使用大写的Lambda符号,Λ,表示^,但表格仍然不完全匹配。

如果现在没有这样的字符,你知道是否有计划添加它们,或者你能想到另一种在终端中显示这样的表格的好方法吗?


3
我认为你唯一能够利用这些斜线字符的方式是让它们相遇于字符单元格的角落,而不是中心-这样你只需要两个字符就能组成方框。(在补充箭头-B中有几种交叉对角线变体,其中一条线明显在另一条线前面通过,可能会对你有用。) - jasonharper
1
我同意@jasonharper的观点。使用等宽字体,它可能看起来与您预期的完全相同(即在此处查看输出,其中顶部是常规ASCII斜杠(代码点47,92),底部是绘图框斜杠(代码点9585,9586)。TIO(显然)使用字体'DejaVu Sans Mono', monospace,以防您想知道)。 - Kevin Cruijssen
2个回答

4
你要寻找的字符不存在。不过你可以按照@jasonharper提供的建议进行操作。
╱╲
╲╱

或者另一种选择:

 ╱╲
╱  ╲
╲  ╱
 ╲╱

2
我希望这不算是太久远的回帖。我也想知道。
好的,我会全神贯注地解决这个问题。我会给你找到所有可能的选项。由于这是一个审美问题,你必须根据项目和需求自行选择。我根据与一个转动的正方形的相似性得出了自己的结论,我猜这就是目标。
事实证明,没有一个特殊字符空间包含所有答案。我希望有这样一个存在。
首先,看起来你特别想在你的菱形中每个角只使用一个字符。这将人为地限制你的选择。
一个由两个字符组成的菱形与一个由一个字符组成的菱形之间的常规空白内部:
  /\                        ^
 /░░\                      /░\
/░hi░\ can't center text  <░!░>  can center text
\░hi░/                     \░/
 \░░/                       v
  \/

如果上面的图对你的项目没有影响的话,那么请考虑使用一个2个字符的菱形,因为它们更容易构建。
每个角落2个字符(如果居中不是问题的话): 这些标题是这些字符来自的Unicode块的名称。
基本拉丁字母
     /\
    /  \    basic solidus diamond for comparison
   /    \     
   \    /       \ slash: solidus
    \  /        / backslash: reverse solidus
     \/

盒子绘图
     ╱╲                                        ╱╲
            box drawing diagonals           /  \
                                           /    \
             like solidus, but jagged.     \    /
             you could mix and match        \  /
     ╲╱        for the best of both worlds:    ╲╱

     ▟▙
    ▟▘▝▙      fun with quadrants and half blocks
   ▟▘  ▝▙     
   ▜▖  ▗▛        
    ▜▖▗▛         
     ▜▛

杂项数学符号-A
       ⟋⟍
                 mathematical rising/falling diagonal
              
                  
             
       ⟍⟋        ||
                  ||       not grid-friendly width

半角和全角形式
       /\
     /    \        fullwidth solidus + reverse solidus
   /        \      basically a perfect diamond
   \        /      grid-friendly only if your grid is in fullwidth,
     \    /        the width of CJK ideographs like 爱
       \/          fullwidth space: " "

杂项数学符号-B
    ⧸⧹
   ⧸  ⧹
  ⧸    ⧹     "big solidus"
  ⧹    ⧸
   ⧹  ⧸         
    ⧹⧸

混合
盒子绘图
     ██      
   ██  ██     double full blocks
 ██      ██      (2 char up & down, 1 char right & left)
   ██  ██    
     ██      

每个角度1个字符(为了保持意义,当我们探索的Unicode块没有任何实验时,我将省略角度):
基本拉丁字母
   ^
  / \     your example for comparison
 <   >    aka the "There Must Be A Better Way To Do This" diamond
  \ /     which we have all struggled with!
   v        

盒子绘图
   █
  █ █     single full blocks
 █   █
  █ █        
   █ 

   ▄
  ▞ ▚     half blocks and quadrants
 ▐   ▌       cramped
  ▚ ▞        
   ▀

杂项技术 杂项技术
   ⍲    "Apl functional symbol up caret tilde" width issues
  /  \
  \  /
   ⍱    "Apl functional symbol down caret tilde"


   ⌃
  / \    up/down arrowhead
  \ /
   ⌄


  ⎠⎝     various parenthesis (probably not useful)
  
  ⎞⎛

  /\
 〈   〉    angle brackets look promising
  \/     unfortunately, width makes it not grid-friendly

在“Miscellaneous Technical”中,“右尖角括号”与“Miscellaneous Mathematical Symbols-A”中的“数学右尖角括号”是相同的。
你能分辨出它们之间的区别吗?
⟩  〉

音标扩展
 ^    ^    (normal caret)
/ \  / \    
\ /  \ /   Left: "Latin subscript small letter v"
 ᵥ    ᵛ    Right: "Modifier letter small v"

 ᴧ    ᴧ   "Greek letter small capital lamda"
/ \  / \
\ /  \ /
 v    ᴠ   normal v for comparison, and "Latin letter small capital v"

杂项数学符号-B
  /\          
 ⦑   ⦒    |   Left/Right angle bracket with dot
  \/     |        width problems
         |
  /\
 ⦉   ⦊   "Z notation [left/right] binding bracket"
  \/            same width problem

丁巴特
 /\
❬  ❭    "Medium [left/right]-pointing angle bracket ornament"
 \/          good width    

常规标点符号
 /\
    "Single [left/right]-pointing angle quotation mark" aka guillemets
 \/        
               good width

统一加拿大原住民音节文字
      ||
 / \   ||    would be great if not for those pesky width issues
     ||   ᐱ: Canadian syllabics pi  ᐯ: pe ᐳ: po ᐸ: pa
 \ /   ||    
      ||

结论: 世界上最好的居中Unicode钻石(没有宽度问题)可能是....(在这里使用正斜杠和反斜杠作为线条):
  ᴧ 
 / \     
❬   ❭
 \ /
  ᴠ

再次提供原文以供比较:
  ^
 / \
<   >
 \ /
  v

没错,这一天又被叮当和国际音标拯救了。老实说,总是如此吧?
但是如果你问我,一点艺术创造力可能会使它更加易于理解。
   |
  / \    using simple solidus (slashes), dashes, and | <-this thing
 -   -
  \ /
   |

我猜这取决于你想要多锐利。

或者,为了完整起见,另一个方向:

   ▁
  / \    block elements 1/8th characters (up, down, left, right)
 ▕   ▏
  \ /
   ▔

谢谢你和我一起走过这段旅程。希望你觉得它至少有些许的用处。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接